Creating event handlers for data tree

For the Data Tree component, you can create event handlers for the individual nodes or for the tree as a whole at a global level.
Note: Data Tree <odc:tree> and Chart <odc:graphDraw> have been enabled to use Server Data.
Note: The Data Tree control's <odc:treeNodeAttr> tag uses different values for its className attribute when bound to SDO data versus WDO data. After migrating a project from a server that uses WDO (such as WebSphere® Application Server 5.1) to one that uses SDO (such as WebSphere Application Server 6.1), the easiest way to fix this is to delete and recreate any Data Tree controls.
In order to write event handlers for a particular node type in the Data Tree, for example, for the nodes representing departments, perform the following steps:
  1. In the Properties view for the Data Tree, select the Tree Node List tab.
  2. In the Select nodes to display box, select the type of node for which you want to write the event handler: odc:tree or odc:treeNodeAttr.
  3. From the right corner, click Create/edit event handlers for node manipulation. This will take you to the Quick Edit view.
  4. In the left frame of the Quick Edit View, select the event for which you want to write the handler. Your event choices depend on which type of tree node you select:
    • For odc:tree, the available events are onnodecollapse, onnodeexpand, onnodehighlight, onnodedeselect, and onnodeunselect. There are no code snippets provided for these events so you must write a custom event handler.
    • For odc:treeNodeAttr, the available events are oncollapse, onexpand, onhighlight, onselect and onunselect. Code snippets for these events are provided, but you can also write your own custom event handlers.
  5. In the right frame, either select an out-of-box event handler using the context menu, or enter in the JavaScriptâ„¢ to write a custom event handler.
For more information on Data Tree event properties, refer to Event handlers for Faces Client components. The odc:tree event handle requires knowledge of eObject in order to gather information the selected node. For information on eObject, refer to Chapter 6: JavaScript Library in FacesClient Components Developer's Guide. Typical usage of eObject is similar to
value = thisEvent.eobject.eGet("refNum");
Where refNum is an attribute of the tree node.
Related concepts
Event handlers for Faces Client components
Related tasks
Creating event handlers for data grid
Related reference
Supported controls

Feedback