Using tree components
The ICEfaces component library provides a robust tree component that can be used to render hierarchical data. By default, the<ice:tree>
tag renders a tree component without any node icons, however, custom node icons can also be defined.
Using the default tree node icons
In this example, we bind the ICEfaces tree component to a model property in our backing bean that represents a set of files and folders on the file system.
<ice:form> <ice:tree value="#{backingBean.treeModel}" var="item" hideRootNode="#{false}" hideNavigation="#{false}"> <ice:treeNode> <f:facet name="content"> <ice:panelGroup style="display: inline"> <ice:outputText value="#{item.userObject.text}" /> </ice:panelGroup> </f:facet> </ice:treeNode> </ice:tree> </ice:form>
The ICEfaces tree component expects the same javax.swing.tree.TreeModel
interface as the Swing
tree component. The nodes of the tree model must be DefaultMutableTreeNode...