NOTE: As of Orbeon Forms 2018.2, this control is not present in the Form Builder toolbox because Form Builder lacks the ability to created hierarchical itemsets, making this control less useful in that context.
What it does
This control allows the user to select a single item from a hierarchical tree representation.
Basic usage
You:
specify appearance="tree" on an <xf:select1> control
generally use an <xf:itemset> element to point to items which are organized in a hierarchy
The user can expand or collapse tree nodes. This doesn't have an impact on the currently-selected value:
Readonly appearance
If the control is readonly, it appears grayed out. It is not possible to select items in this case, but it is possible to open/close tree nodes:
Controlling which tree nodes are initially open
The <xf:itemset> element supports the xxf:open extension attribute, which determines which nodes of the tree are open when the tree is first rendered. You can use <xf:itemset xxf:open="true"> if you want all the nodes to be open. If you have a condition under which nodes should be open, use an AVT. For instance, the following will open just the first level of the tree. If you wanted to open all the nodes up to 3 levels of depth, you would instead write {count(ancestor-or-self::item) le 3}.
Starting with Orbeon Forms 2017.1, the implementation of the tree appearance uses the Fancytree JavaScript library.
NOTE: This is subject to change in new versions of Orbeon Forms.
However you can look at the markup produced by Fancytree with your browser's development tools and apply custom CSS to style the tree. All icons are set with CSS. Here is an example of the HTML layout: