Adding a Tree View
The Tree View allows you to display hierarchical data, such as an organization chart. In an organization chart, each department would be a node. The user can expand and collapse the nodes to view different parts of the organization. You bind the tree to a Client Data Object and define properties to determine how each node is displayed. In this scenario, your Page Data Object and Client Data Object return a list of departments and subdepartments.
Use the following steps to put a Tree View on a JSP page.
- In the Web perspective, open your JSP page and the Faces Client Components drawer from the palette.
- Drag theTree View control onto the JSP page.
- From the Client Data view, select and drag the property that will be the root of the tree onto the Tree View component. This step binds the Client Data to the Tree View.
- Select the Tree View component on the JSP page.
- Go to the Properties view to set the attributes.
- Optional: On the odc:tree tab, set tree size, modify style classes, and enable node selection.
- On the Tree Node List tab, select the nodes to display from the Client Data and which attributes to display on each node. For example, the department name or the manager of the department.
- Save and run the JSP page on a test server when you have finished
Note: For more information on the Tree View, press the F1 key in the Properties view.