Using HTML Tree Actions (Events)

The GenerateTree function works with an HTML area control and an invisible field. When a user selects a node, expands a node, collapses a node, or uses one of the navigation links, that event (user action) is passed to the invisible field, and the FieldChange PeopleCode for the invisible field is executed.

The FieldChange PeopleCode example program (below) checks for expanding (or collapsing) a node and selecting a node by checking the first character in the invisible field. The following example checks for whether a node is selected:

If Left(TREECTLEVENT, 1) = "S" Then

In your application, you can check for the following user actions:

Event Description

Tn

Expand or collapse the node, whichever is the opposite of the previous state. N is the row number of the node in the TREECTL_NODE rowset.

Xn

Expand the node, but load the children first. The children are loaded in PeopleCode, and then the event is passed to GenerateTree so that the HTML can be generated with the node expanded. N is the row number of the node in the TREECTL_NODE rowset.

F

Display the first page.

P

Display the previous page.

N

Display the next page.

L

Display the last page.

Q

Move the display left one level.

R

Move the display to the right one level.

Sn

Select the node or leaf. N is the row number of the node or leaf in the TREECTL_NODE rowset.

Note:

Drag-and-drop functionality is not supported in an HTML tree.