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.

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.

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 events 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

Either "lazy" or "immediate". If "lazy", then hierarchy viewer's content is fetched after the hierarchy viewer is sent to the browser. If "immediate", then the hierarchy viewer content is immediately sent to the browser

controlPanelBehavior

String

Yes

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.

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.

id

String

No

the identifier for the component. The identifier must follow a subset of the syntax allowed in HTML:

Must not be a zero-length String.

First character must be an ASCII letter (A-Za-z) or an underscore ('_').

Subsequent characters must be an ASCII letter or digit (A-Za-z0-9), an underscore ('_'), or a dash ('-').

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.

"circle" - layout with root node in center and all leaf nodes arranged in concentric circle, with parent nodes arranged within the circle

levelFetchSize

int

Yes

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.

navigateUpListener

String

Yes

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

Specifies the selection mode. Valid values are:

"none" - no nodes can be selected

"single" - a single node can be selected

"multiple" - multiple nodes can be selected

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

Specifies whether the component is rendered

selectionListener

String

Yes

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

Yes

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).