Print Options Action Listener to Handle the Print Event

29 Using ADF Hierarchy Viewer Components 29-1 29 Using ADF Hierarchy Viewer Components This chapter describes how to use an ADF hierarchy viewer component to display data, and provides the options for hierarchy view customization. This chapter includes the following sections: ■ Section 29.1, Introduction to Hierarchy Viewers ■ Section 29.2, Data Requirements for Hierarchy Viewers ■ Section 29.3, Managing Nodes in a Hierarchy Viewer ■ Section 29.4, Navigating in a Hierarchy Viewer ■ Section 29.5, Adding Interactivity to a Hierarchy Viewer Component ■ Section 29.6, Using Panel Cards ■ Section 29.7, Customizing the Appearance of a Hierarchy Viewer ■ Section 29.8, Adding Search to a Hierarchy Viewer For information about the data binding of ADF hierarchy viewers, see the Creating Databound Hierarchy Viewers section in the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework.

29.1 Introduction to Hierarchy Viewers

A hierarchy viewer component can be used to visually display hierarchical data. Hierarchical data contains master-detail relationships within the data. For example, you could create a hierarchy viewer component that renders an organization chart from a data collection that contains information about the relationships between employees in an organization.

29.1.1 Understanding the Hierarchy Viewer Component

JDeveloper generates the following elements in JSF pages when you drag and drop components from the Component Gallery onto a JSF page or when you use the Create Hierarchy Viewer dialog to create a 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. ■ dvt:hierarchyViewer This element wraps the dvt:node and the dvt:link elements. ■ dvt:node 29-2 Web User Interface Developers Guide for Oracle Application Development Framework A node is a shape that references the data in a hierarchy, for example, employees in an organization or computers in a network. You configure the child elements of the dvt:node element to reference whatever data you want to display. The dvt:node element supports the use of one or more f:facet elements that display content at different zoom levels 100, 75, 50, and 25. The f:facet element supports the use of many ADF Faces components, such as af:outputText, af:image, and af:panelGroupLayout, in addition to the ADF Data Visualization dvt:panelCard component. At runtime, the node contains controls that allow users to navigate between nodes and to show or hide other nodes by default. For information about specifying node content and defining zoom levels, see Section 29.3.1, How to Specify Node Content. ■ dvt:link You set values for the attributes of the dvt:link element to connect one node with another node. For information about how to customize the appearance of the link and add labels, see Section 29.7.4, How to Configure the Display of Links and Labels. ■ dvt:panelCard The panel card element provides a method to dynamically switch between multiple sets of content referenced by a node element using animation by, for example, horizontally sliding the content or flipping a node over. The f:facet tag for each zoom level supports the use of a dvt:panelCard element that contains one or more af:showDetailItem elements defining the content to be displayed at the specified zoom level. At runtime, the end user uses the controls on the node to dynamically switch between the content that the af:showDetailItem elements reference. For more information, see Section 29.6, Using Panel Cards. The hierarchy viewer component uses elements such as af:panelGroupLayout, af:spacer, and af:separator to define how content is displayed in the nodes. Example 29–1 shows the code generated when the component is created by insertion from the Component Palette. Code related to the hierarchy viewer elements is highlighted in the example. Example 29–1 Hierarchy Viewer Sample Code dvt:hierarchyViewer id=hierarchyViewer1 layout=hier_vert_top inlineStyle=width:100;height:600px; dvt:link linkType=orthogonalRounded id=l1 dvt:node width=233 height=330 id=n1 f:facet name=zoom100 af:panelGroupLayout layout=vertical inlineStyle=width:100;height:100;padding:5px id=pgl2 af:panelGroupLayout layout=horizontal id=pgl3 af:panelGroupLayout inlineStyle=width:85px;height:120px Note: Unlike the other elements, the dvt:panelCard element is not generated if you choose the default quick layout option when using the Component Gallery to create a hierarchy viewer. For more information see, Section 29.1.3, Available Hierarchy Viewer Layout Options.