Creating Collapsible Panes with the Panel Splitter Component
Another feature of the panel splitter component is that users can collapse or restore its panes. When a pane is collapsed, the pane contents are hidden; when a pane is restored, the contents are displayed. The collapsed attribute on af:panelSplitter determines whether the splitter is in a collapsed (hidden) state. By default, the collapsed attribute is false, which means both panes are displayed. When the user clicks the arrow button on the splitter, collapsed is set to true and one of the panes is hidden.
ADF Faces uses the collapsed and positionedFromEnd attributes to determine which pane (that is, the first or second pane) to hide (collapse) when the user clicks the arrow button on the splitter. When collapsed is true and positionedFromEnd is false, the first pane is hidden and the second pane stretches to fill up the available space. When collapsed is true and positionedFromEnd is true, the second pane is hidden instead. Visually, the user can know which pane will be collapsed by looking at the direction of the arrow on the button; when the user clicks the arrow button on the splitter, the pane collapses in the direction of the arrow. The splitterPosition and collapsed attributes are persistable; that is, when the user moves the splitter or collapses a pane, ADF Faces can implicitly persist the attribute value changes for the component.