Create new RichFaces Documentation Jira issue

This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

6.9.4.  < rich:recursiveTreeNodesAdaptor > available since 3.1.0

The <rich:recursiveTreeNodesAdaptor> is an extension of a <rich:treeNodesAdaptor> component that provides the possibility to define data models and process nodes recursively.


The <rich:recursiveTreeNodesAdaptor> component has a "roots" attribute that defines collection to use at the top of recursion.

The "nodes" attribute defines collection to use on another recursion levels.

The "var" attribute is used to access to the current collection element.

The <rich:recursiveTreeNodesAdaptor> component can be nested without any limitations. See the following example.

Example:


...
<rich:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
    <rich:treeNodesAdaptor id="project" nodes="#{loaderBean.projects}" var="project">   
        <rich:treeNode>
            <h:commandLink action="#{project.click}" value="Project: #{project.name}" />
        </rich:treeNode>
        <rich:recursiveTreeNodesAdaptor id="dir" var="dir" root="#{project.dirs}" nodes="#{dir.directories}">
            <rich:treeNode>
                <h:commandLink action="#{dir.click}" value="Directory: #{dir.name}" />
            </rich:treeNode>            
            <rich:treeNodesAdaptor id="file" var="file" nodes="#{dir.files}">
                <rich:treeNode>
                    <h:commandLink action="#{file.click}" value="File: #{file.name}" />
                </rich:treeNode>
            </rich:treeNodesAdaptor>
            <rich:treeNodesAdaptor id="file1" var="file" nodes="#{dir.files}">
                <rich:treeNode>
                    <h:commandLink action="#{file.click}" value="File1: #{file.name}" />
                </rich:treeNode>
            </rich:treeNodesAdaptor>
            <rich:recursiveTreeNodesAdaptor id="archiveEntry" var="archiveEntry"
                            roots="#{dir.files}" nodes="#{archiveEntry.archiveEntries}" 
                            includedRoot="#{archiveEntry.class.simpleName == 'ArchiveFile'}"
                            includedNode="#{archiveEntry.class.simpleName == 'ArchiveEntry'}">      
                <rich:treeNode id="archiveEntryNode">
                    <h:commandLink action="#{archiveEntry.click}" value="Archive entry: #{archiveEntry.name}" />
                </rich:treeNode>
            </rich:recursiveTreeNodesAdaptor>
        </rich:recursiveTreeNodesAdaptor>
    </rich:treeNodesAdaptor>
</rich:tree>
...

Table of <rich:recursiveTreeNodesAdaptor> attributes.


On the component Live Demo page you can see the example of <rich:recursiveTreeNodesAdaptor> usage.