Using Tree Tables (continued)
Both the af:tree and af:treeTable components render icons that the user can click to expand or collapse a subtree. When the user clicks one of these icons, the component generates a RowDisclosureEvent (you learn more about events in the lesson titled “Responding to Application Events”). The event has two RowKeySet objects: RemovedSet for all the collapsed nodes and AddedSet for all the expanded nodes. The component expands the subtrees under all nodes in the added set and collapses the subtrees under all nodes in the removed set.
You can register custom RowDisclosureListener instances, which can do post processing, on the tree component.
The af:tree and af:treeTable components use an instance of the oracle.adf.view.rich.model.RowKeySet class to keep track of which elements are expanded. This instance is stored as the disclosedRowKeys attribute on the component. You can use this instance to control the expand or collapse state of an element in the hierarchy programmatically. Any element contained by the RowKeySet instance is expanded, and all other elements are collapsed. The addAll() method adds all elements to the set, and the removeAll() method removes all the elements from the set.