Organization Chart Actions and Events

An organization chart can execute FieldEdit or FieldChange PeopleCode in response to these user actions:

  • Select an expand/collapse icon.

  • Click a descriptor link.

  • Select a linkable drop-down menu item or drop-down list box item.

  • Close a pop-up node.

  • Select a breadcrumb.

  • Click on a node image.

  • Click on a node.

Selecting Expand/Collapse Icons

When the user clicks an expand/collapse icon, the system toggles the EXPANDED_FLAG field value from “Y” to “N” or from “N” to “Y” and changes the icon on the node to collapsed or expanded, correspondingly. This action triggers field change processing (FieldEdit and FieldChange events) on EXPANDED_FLAG. Typically, FieldChange PeopleCode checks the EXPANDED_FLAG and PARENT_FLAG of the node and performs these actions:

  • If EXPANDED_FLAG="Y" and PARENT_FLAG="X", loads the child rows into the rowset and sets PARENT_FLAG="Y". The updates appear when the chart is refreshed.

  • If EXPAND_FLAG="N" (collapse action), it does nothing.

  • If EXPAND_FLAG="Y" (expand action) and PARENT_FLAG="Y" (child data is already in rowset), it does nothing.

Note:

If your PeopleCode doesn’t populate the CollapsedImage and ExpandedImage properties of the organization chart, then no expand/collapse icon appears on any nodes in the chart, and the expand/collapse action is disabled for the chart.

Clicking a Descriptor Link

When the user clicks a descriptor link or linkable drop-down list item, field change processing is triggered on the PTNODE_DESCRn field in the node record.

For instance, suppose descriptor 2 is linked to a pop-up chart. When the user clicks the descriptor 2 link, FieldChange PeopleCode on the PTNODE_DESCR2 field in the node record performs the following actions:

  • Sets the node’sPTPOPUPEXPAND_FLAG ="Y".

  • Sets the node’s PTPOPUPHDRMAINDESC.

  • Sets the node’s PTPOPUPHDRMAINICON.

  • If the node’s PTHASPOPUP_FLAG ="X", then populates the pop-up node rowset and sets PTHASPOPUP_FLAG ="Y" to indicate that the node’s descriptor was clicked for the first time.

  • Refresh the chart with the pop-up displayed.

Closing a Pop-up Node

When the user closes a pop-up node it triggers field change processing on the PTPOPUPEXPAND_FLAG field.

FieldChange PeopleCode on the PTPOPUPEXPAND_FLAG field would need to restore any changes that were made to the originating node's display characteristics and reset the node’s PTPOPUPEXPAND_FLAG ="N" .

Selecting a Linkable Menu Item or Drop-Down List Box Item

When a user selects a linkable menu item or drop-down list box item, the system sets the PTDESCRn_SI_ID (PTDESn_SLCT_ITM_ID if not using a node display record) field value to the value of the list item ID and FieldChange PeopleCode associated with the PTNDDESCnLINKABLE field executes.

Selecting a Breadcrumb

When a user clicks on a linkable breadcrumb, any FieldEdit and FieldChange PeopleCode in the PTORGCRMBID field executes. Typically PeopleCode is used to redraw the organization giving focus to the node that was clicked.

Clicking on a Photograph

When a user clicks on a node image, field change PeopleCode on the PTNDMAINICON_IMAGE field executes.

Clicking on a Node

When a user clicks on the body of a node – not on a link, linkable drop-down list, or image – field change PeopleCode on the PTCHART_NODE field executes.