Oracle Fusion Middleware Data Visualization Tools Tag Reference for Oracle ADF Faces
12c (12.1.3)

E41655-01

<dvt:hierarchyViewer>

dvt:hierarchyViewer hierarchyViewer hierarchy viewer

UIComponent class: oracle.adf.view.faces.bi.component.hierarchyViewer.UIHierarchyViewer
Component type: oracle.dss.adf.hierarchyViewer.HierarchyViewer

The ADF hierarchy viewer component displays hierarchical data as a set of linked nodes in a diagram. The nodes and links correspond to the elements and relationships to the data. The component supports pan and zoom operations, expanding and collapsing of the nodes, and rendering of simple ADF components within the nodes. A common use of the hierarchy viewer is to display an organization chart.

Relationship with other tags

The hierarchy viewer component can have the following children: <af:dragSource>, <af:dropTarget>, <dvt:link>, <dvt:node>, <dvt:search>.

The <dvt:panelCard> can be used in conjunction with <dvt:node>. See the documentation for those tags for more information.

Example

The following example shows XML for a hierarchyViewer tag.
<dvt:hierarchyViewer id="hierarchyViewer1" layout="hier_vert_top" inlineStyle="width:100%;height:600px;" var="node" value="#{bindings.rootEmp1.treeModel}">
  <dvt:link linkType="directRounded"/>
  <dvt:node width="233" height="233">
    <f:facet name="zoom100">
      <af:panelGroupLayout layout="vertical" inlineStyle="width:100%;height:100%;padding:5px">
        <af:panelGroupLayout layout="horizontal">
          <af:panelGroupLayout inlineStyle="width:85px;height:120px">
            <af:image source="#{node.Thumburl}"/>
          </af:panelGroupLayout>
          <af:spacer width="5" height="5"/>
          <af:panelGroupLayout layout="vertical">
            <af:outputText value="#{node.Firstname}" inlineStyle="font-weight:bold;font-size:20px;color:#383A47"/>
            <af:outputText value="#{node.Lastname}" inlineStyle="font-size:20px;color:#383A47"/>
            <af:outputText value="#{node.Title}" inlineStyle="font-size:11px;font-style:italic;color:#383A47"/>
          </af:panelGroupLayout>
        </af:panelGroupLayout>
      </af:panelGroupLayout>
    </f:facet>
  </dvt:node>
</dvt:hierarchyViewer>

Gradient background

By default, the hierarchy viewer displays a gradient background that transitions from its background-color to white. The gradient can be turned off so that the background is a solid color by specifying the custom attribute "fill-type:solid" in the inlineStyle attribute on the <dvt:hierarchyViewer> tag.

Geometry Management

Drag and Drop

The hierarchy viewer can be used as both a drag source and a drop target. To do so, a developer must add one or both of the <af:dragSource> and <af:dropTarget> tags as direct children of the <dvt:hierarchyViewer> tag. The following example shows a hierarchy viewer configured as both a drag source and a drop target.
<dvt:hierarchyViewer>
<af:dragSource actions="COPY MOVE" defaultAction="MOVE" />
<af:dropTarget dropListener="#{myBean.dropListener}" actions="COPY MOVE" >
<af:dataFlavor flavorClass="java.lang.Object" />
<af:dataFlavor flavorClass="org.apache.myfaces.trinidad.model.RowKeySet" />
</af:dropTarget>
<dvt:node ... > ... </dvt:node>
</dvt:hierarchyViewer>
One or more nodes may be dragged from the hierarchy viewer. Multiple selection must be enabled on the hierarchy viewer to allow dragging multiple nodes. To drag multiple nodes, the set of nodes must be selected before dragging, and the drag must be initiated on a selected node in the set. The data in the transferable for a drag originating from a hierarchy viewer will be of type org.apache.myfaces.trinidad.model.RowKeySet.
A drop on a hierarchy viewer can occur on a node or on the background. The java.util.Map drop site retrieved from the drop event will contain a value for the "clientRowKey" key. This value will specify the client row key for the node on which the drop occurred, or null if it occurred on the background.

Screen Shot(s)


Hierarchy Viewer screenshot

Events

Type Phases Description
org.apache.myfaces.trinidad.event.AttributeChangeEvent Invoke Application,
Apply Request Values
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.

Attributes

Name Type Supports EL? Description
attributeChangeListener javax.el.MethodExpression Only EL a method reference to an attribute change listener. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing.
binding String Only EL binding reference to store the UIHierarchyViewer component
contentDelivery String Yes Valid Values: whenAvailable, lazy, immediate
Default Value: whenAvailable

Options are "lazy", "immediate", and "whenAvailable". If "lazy", then the hierarchyViewer content is fetched after the hierarchyViewer is sent to the browser. If "immediate", then the hierarchyViewer content is immediately sent to the browser. If "whenAvailable", then "immediate" content delivery is used if the data is already available; otherwise "lazy" content delivery is used. The default value is "whenAvailble".
controlPanelBehavior String Yes Valid Values: initCollapsed, initExpanded, hidden
Default Value: initCollapsed

Specifies the behavior of the control panel. Valid values are:

  • "initCollapsed" - initially collapsed
  • "initExpanded" - initially expanded
  • "hidden" - hidden from view
customizationId String Yes This attribute is deprecated. The 'id' attribute should be used when applying persistent customizations. This attribute will be removed in the next release.
detailWindow String Yes Valid Values: auto, default, none
Default Value: auto

Specifies whether to show the detail window. Valid values are:

  • "default" - show the detail window when hovering over a node that is not at 76 - 100% zoom level (deprecated)
  • "auto" - detail window enabled with device specific gesture for hover over a node that is not at 76 - 100% zoom level (default)
  • "none" - suppress the detail window
disclosedRowKeys org.apache.myfaces.trinidad.model.RowKeySet Yes the set of disclosed rows for this component. Each entry in the set is a rowKey.
displayLevelsAncestor int Yes The number of ancestor levels to display during initial render. This property is 0-based. A value of 0 means that no ancestor levels above the root will be shown. The default value is 0.
displayLevelsChildren int Yes The number of child levels to display during initial render. This property is 0-based. A value of 0 means that no child levels below the root will be shown; the root itself will be shown. The default value is 1, which means that the root and the first level of children will be shown.
dontPersist String[] Yes List of persistent attributes that are restricted from persisting to a registered "Persistent Change Manager". Persistent attributes would still persist to a session.
emptyText String Yes The text of an empty hierarchy viewer.
featuresOff java.util.Set Yes This feature is deprecated. A list of default features to turn off for the hierarchyViewer. Currently the supported values are "pan", "zoom", "zoomToFit", "changeLayout", "cardSync", and "nodeDetail".
id String No the identifier for the component
inlineStyle String Yes The inline style of the hierarchy viewer's outer DOM element. Can be used to control the size/position of the hierarchy viewer.
layout String Yes Valid Values: hier_vert_top, hier_vert_bottom, hier_horz_left, hier_horz_right, hier_horz_start, hier_horz_end, tree, radial, circle
Default Value: hier_vert_top

Specifies the layout of the hierarchy. Valid values are:

  • "hier_vert_top" - top-to-bottom vertical hierarchy
  • "hier_vert_bottom" - bottom-to-top vertical hierarchy
  • "hier_horz_left" - left-to-right horizontal hierarchy
  • "hier_horz_right" - right-to-left horizontal hierarchy
  • "hier_horz_start" - horizontal hierarchy whose direction depends on the locale
  • "hier_horz_end" - horizontal hierarchy whose direction depends on the locale
  • "tree" - indented tree
  • "radial" - layout with root node in center and successive child levels radiating outward from their parent nodes
  • "circle" - layout with root node in center and all leaf nodes arranged in concentric circle, with parent nodes arranged within the circle
layoutChange String Yes Valid Values: auto, none
Default Value: auto

Specifies layout change behavior. Valid values are:

  • "auto" - layout change enabled with device specific gesture (default)
  • "none" - layout change will be disabled
levelFetchSize int Yes Default Value: 25

Specifies the number of child nodes that will be fetched and displayed at a single time for each expanded parent node. Additional child nodes may be fetched and displayed by using the lateral navigation controls shown in the hierarchy viewer. The default value is 25. The name of this attribute is levelFetchSize.
navigateUpListener javax.el.MethodExpression Only EL a method reference to a navigate up action listener, the method is invoked when the end user tries to navigate up from the current root node
nodeSelection String Yes Valid Values: none, single, multiple
Default Value: multiple

Specifies the selection mode. Valid values are:

  • "none" - no nodes can be selected
  • "single" - a single node can be selected
  • "multiple" - (Default) multiple nodes can be selected
panelCardSync String Yes Valid Values: auto, none
Default Value: auto

Specifies panel card sync behavior. Valid values are:

  • "auto" - panel card sync enabled with device specific gesture (default)
  • "none" - panel card sync will be disabled
panning String Yes Valid Values: auto, tilt, none, default
Default Value: auto

Specifies panning behavior. Valid values are:

  • "default" - click-and-drag panning (deprecated)
  • "tilt" - click-and-drag panning with automatic 3D tilt panning enabled (deprecated)
  • "auto" - panning enabled with device specific gesture (default)
  • "none" - panning will be disabled
partialTriggers String[] Yes the IDs of the components that should trigger a partial update. This component will listen on the trigger components. If one of the trigger components receives an event that will cause it to update in some way, this component will request to be updated too.
persist String[] Yes List of persistent attributes that are persisting to a registered "Persistent Change Manager". Persistent attributes, by default, always persist to a session.
rendered boolean Yes Default Value: true

Specifies whether the component is rendered
rowDisclosureListener javax.el.MethodExpression Only EL a method reference to a rowDisclosure listener, the method is invoked when a node is expanded or collapsed
selectedRowKeys org.apache.myfaces.trinidad.model.RowKeySet Yes the set of selected rows for this component. Each entry in the set is a rowKey.
selectionListener javax.el.MethodExpression Only EL a method reference to a selection listener, the method is invoked when the selected nodes are changed.

        public void nodeSelected(SelectionEvent selectionEvent) {

          UIHierarchyViewer hv = (UIHierarchyViewer) selectionEvent.getSource();
          RowKeySet addedSet = selectionEvent.getAddedSet();
          Iterator i = addedSet.iterator();

          TreeModel model = (TreeModel)hv.getValue();
          model.setRowKey(i.next());

          Object selectedNode = model.getRowData();
         //then cast the selected node to the tree model specific type
         //in this example, it is a single selection model, so, you only need to get the only rowkey in the selection event

         // note, the selectionEvent is of org.apache.myfaces.trinidad.event.SelectionEvent
         //...
         }
        
        
styleClass String Yes Sets a CSS style class to use for this component.
summary String Yes Sets a summary of this hierarchy viewer's purpose and structure for user agents rendering to non-visual media (e.g. screen readers).
value String Yes the data model for the hierarchy viewer - can be an instance of javax.faces.TreeModel
var String No Name of the EL variable used to reference each element of this collection. Once this component has completed rendering, this variable is removed (or reverted back to its previous value).
zooming String Yes Valid Values: auto, none
Default Value: auto

Specifies zooming behavior. Valid values are:

  • "auto" - zooming enabled with device specific gesture (default)
  • "none" - zooming will be disabled