Using HTML Tree Rowset Records

The GenerateTree function takes a prebuilt and populated rowset as a parameter. This rowset must have a certain structure and contain certain fields. In the following examples, the rowset is standalone, that is, the rowset is created using the CreateRowset function. The fields necessary for the rowset are contained in the following record definitions:

  • The header record TREECTL_HRD, containing the subrecord TREECTL_HDR_SBR.

  • The node record TREECTL_NDE, containing the subrecord TREECTL_NDE_SBR.

The header record is the level zero record of the HTML tree rowset. It contains options for the HTML tree, such as the name of the collapsed node image, the height of the images, the number of pixels to indent each node, and so on.

The node record is the level one record of the HTML tree rowset. It contains the tree data and information about the data, such as the dynamic range leaf, the level, and so on.

The level one scroll area contains a row for each node or leaf in the tree data.

To store additional application data with each node in the tree, you can incorporate the TREECTL_NDE_SBR into a record of your definition and use your record to define the HTML tree rowset.

For example, you might want to store application key values with each node record, so that when a user selects a node, you have the data you need to perform the action that you want.

This table describes the relevant fields in TREECTL_HDR_SBR:

Field Description

PAGE_NAME

Name of the page that contains the HTML area and the invisible field used to process the HTML tree events.

PAGE_FIELD_NAME

Page field name of the invisible field used to process the HTML tree events.

PAGE_SIZE

Number of nodes or leaves to send to the browser at a time. Set to 0 to send all visible nodes or leaves to the browser. The default value is 0.

DISPLAY_LEVELS

Number of levels to display on the browser at a time. The default value is 8.

COLLAPSED_IMAGE

Collapsed node image name. The default value is PT_TREE_COLLAPSED.

EXPANDED_IMAGE

Expanded node image name. The default value is PT_TREE_EXPANDED.

END_NODE_IMAGE

End node image name. The default value is PT_TREE_END_NODE.

LEAF_IMAGE

Leaf image name. The default value is PT_TREE_LEAF.

IMAGE_WIDTH

Image width in pixels. All four images need to be the same width. The default value is 15 pixels.

IMAGE_HEIGHT

Image height in pixels. All four images need to be the same height. The default value is 12 pixels.

INDENT_PIXELS

Number of pixels to indent each level. The default value is 20 pixels.

TREECTL_VERSION

Version of the HTML tree. The default value is 812. Used with the DESCR_IMAGE field in the TREECTL_HDR_SBR record.

This table describes the relevant fields in TREECTL_NDE_SBR:

Field Description

LEAF_FLAG

If this is a leaf, set to Y. The default value is N.

TREE_NODE

Node name.

DESCR

(Optional) Node description.

RANGE_FROM

The range from value of the leaf.

RANGE_TO

The range to value of the leaf.

DYNAMIC_FLAG

If this leaf has a dynamic range, set to Y. The default value is N.

ACTIVE_FLAG

Set to N for the node or leaf not to be a link. The default value is Y.

DISPLAY_OPTION

Set to N to display the name only. Set to D to display the description only. Set to B to display both the name and the description. Used for nodes only. The default value is B.

STYLECLASSNAME

Use to control the style of the link associated with the node or leaf. The default value is PSHYPERLINK.

PARENT_FLAG

If this node is a parent and its direct children are loaded now, set to Y. If this node is a parent and its direct children are loaded on demand, set to X. If this node is not a parent, set to N. The default value is N.

TREE_LEVEL_NUM

Set to the level of the node. The default value is 1.

LEVEL_OFFSET

If a child node is to appear more than one level to the right of its parent, specify the number of additional levels. The default value is 0.

DESCR_IMAGE

Use to display an image after the node or leaf image and before the name or description. The two images are separated by a space. The new image is not scaled. This field takes a string value, the name of an image definition created in PeopleSoft Application Designer.

This field is only recognized if the TREECTL_VERSION field is greater than or equal to 812.

EXPANDED_FLAG

When the EXPANDED_FLAG of a node is set to Y, the GenerateTree function expects the immediate children of the node to be loaded into the &TREECTL rowset (such as in PostBuild), and GenerateTree generates HTML such that the node is expanded and its immediate children appear.