Hierarchy Viewer Elements and Terminology

29-8 Web User Interface Developers Guide for Oracle Application Development Framework Figure 29–5 Component Gallery for Hierarchy Viewer Components

29.2 Data Requirements for Hierarchy Viewers

A hierarchy viewer component requires data collections where a master-detail relationship exists between one or more detail collections and a master detail collection. The hierarchy viewer component uses the same data model as the ADF Faces tree component. You can test whether it is possible to bind a data collection to a hierarchy viewer component by first binding it to an ADF Faces tree component. If you can navigate the data collection using the ADF Faces tree component, it should be possible to bind it to a hierarchy viewer component. When you add a hierarchy viewer component to a JSF page, JDeveloper adds a tree binding to the page definition file for the JSF page. For information about how to populate nodes in a tree binding with data, see the Using Trees to Display Master-Detail Objects section in the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework. The data collections that you bind to nodes in a hierarchy viewer component must contain a recursive accessor if you want users to be able to navigate downward from the root node of the hierarchy viewer component. For more information about navigating a hierarchy viewer component, see Section 29.4, Navigating in a Hierarchy Viewer.

29.3 Managing Nodes in a Hierarchy Viewer

A node is a shape that represents the individual elements in a hierarchy viewer component at runtime. Examples of individual elements in a hierarchy viewer component include an employee in an organization chart or a computer in a network diagram. By default, each node in a hierarchy viewer component includes controls that allows users to do the following: Using ADF Hierarchy Viewer Components 29-9 ■ Navigate to other nodes in a hierarchy viewer component The top of each node contains a single Restore or Isolate button to either display the parent node or single out the node as the anchor node in the hierarchy viewer. One exception is the node at the very top of the hierarchy viewer component, because this node has no parent nodes and may not be isolated. ■ Show or hide child nodes of the currently selected node in a hierarchy viewer component The single Show or Hide button appears on the bottom of every node that is a not a leaf node. If you use a panel card to display different sets of information for the node that the hierarchy viewer component references, controls at the bottom of the node allow the user to change the information set in the active node. For more information, see Section 29.6, Using Panel Cards. Figure 29–6 shows an example of a node with controls that allow an end user to isolate the node as the anchor node, show the child nodes, and change the node to show different sets of information in the active node. For information about how to configure the controls on a node, see Section 29.3.2, How to Configure the Controls on a Node. Figure 29–6 Node Controls There are four basic types of nodes: ■ Root nodes are the uppermost visible nodes in a hierarchy viewer component. A root node is always the root of the hierarchy returned from the tree component. Typically, only one root node is visible at a time. However, there could be more than one root node depending on the use case that you implement for example, in a family tree. ■ An anchor node is the node that has focus whenever the hierarchy viewer component is rendered. There is always just one anchor node visible. The anchor node may be the same as the root node if child nodes are defined for the tree node and if the value of the hierarchy viewer component’s displayLevelsAncestor property is equal to 0. At runtime, if a user double-clicks another node that has a value specified for its setAnchorListener property, that node becomes the anchor node. An anchor node may also be an inner or leaf node, depending on whether or not it has child nodes. For information about how to specify an anchor node, see Section 29.3.4, How to Associate a Node Definition with a Particular Set of Data Rows. You can specify one or more ancestor levels above the anchor node. For more information, see Section 29.3.5, How to Specify Ancestor Levels for an Anchor Node. 29-10 Web User Interface Developers Guide for Oracle Application Development Framework ■ Inner nodes are nodes that have child nodes. ■ Leaf nodes are nodes that do not have child nodes. Figure 29–7 illustrates how a node can be a different type depending on the layout of the hierarchy viewer component. Figure 29–7 Node Types and Positions

29.3.1 How to Specify Node Content

Although a node contains controls by default that allow you to navigate to a node and show or hide nodes, nodes do not by default include content unless you used a quick start layout when creating the hierarchy viewer component. You must define what content a node renders at runtime. You can specify node content when you associate data bindings with the hierarchy viewer component as described in the Creating Databound Hierarchy Viewers section in the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework. By default, a hierarchy viewer component that you create contains one node with one facet element that has a zoom level of 100: f:facet name=zoom100 You can insert three more instances of the facet element into the hierarchy viewer component with the following zoom levels: ■ 25: zoom25 ■ 50: zoom50 ■ 75: zoom75 Use these zoom level definitions to improve readability of node content when the hierarchy viewer is zoomed out to display more nodes and less display room is available in each node. You can define a subset of the available data collection within one or more of the facet elements. For example, if you have a data collection with node attributes that references data about a company department such as its name, location, and number, you can specify a facet element with a zoom level of 50 that references the node attribute for the department’s name and number. At runtime, when a user moves the mouse over a node at any zoom level, a hover window displaying node content at zoom level 100 is automatically displayed, allowing the user to see the full information regardless of zoom level. The controls on the hover window are active when the node has been selected in the hierarchy viewer. Each of the facet elements that you insert can be used to reference other components. You can use one or more of the following components when you define content for a node in a hierarchy viewer component. The node component facet’s support the following components: