6.9.3. < rich:treeNodesAdaptor > available since 3.1.0

### Create new RichFaces Documentation Jira issue

Summary
255 characters left
Description
Environment
This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.org Community Documentation

- Prev
- Next

### 6.9.3. < rich:treeNodesAdaptor > available since 3.1.0

expand all

#### 6.9.3.1. Description

The <rich:treeNodesAdaptor> provides the possibility to define data models and create representations for them.

Figure 6.72. Expanded tree with <rich:treeNodesAdaptor>

#### 6.9.3.2. Key Features

- Allows to define combined data models

- Possibility to define nodes for processing via attributes

#### 6.9.3.3. Details of Usage

The <rich:treeNodesAdaptor> component has a "nodes" attribute that defines a collection of elements to iterate through.

Collections are allowed to include lists, arrays, maps, XML NodeList and NamedNodeMap either as a single object.

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

The <rich:treeNodesAdaptor> 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:treeNodesAdaptor id="srcDir" var="srcDir" nodes="#{project.srcDirs}">

            <rich:treeNode>

                <h:commandLink action="#{srcDir.click}" value="Source directory: #{srcDir.name}" />

            </rich:treeNode>

        <rich:treeNodesAdaptor id="pkg" var="pkg" nodes="#{srcDir.packages}">

            <rich:treeNode>

                <h:commandLink action="#{pkg.click}" value="Package: #{pkg.name}" />

            </rich:treeNode>

        <rich:treeNodesAdaptor id="class" var="class" nodes="#{pkg.classes}">

            <rich:treeNode>

                <h:commandLink action="#{class.click}" value="Class: #{class.name}" />

            </rich:treeNode>

        </rich:treeNodesAdaptor>

        </rich:treeNodesAdaptor>

        </rich:treeNodesAdaptor>

        </rich:treeNodesAdaptor>

    </rich:tree>

    ...

#### 6.9.3.4. Reference Data

Table of <rich:treeNodesAdaptor> attributes.

Table 6.100. Component Identification Parameters

Name | Value
--- | ---
component-type | org.richfaces.TreeNodesAdaptor
component-class | org.richfaces.component.html.HtmlTreeNodesAdaptor
component-family | org.richfaces.TreeNodesAdaptor
tag-class | org.richfaces.taglib.TreeNodesAdaptorTag

#### 6.9.3.5. Relevant Resources Links

On the component LiveDemo page you can see the example of <rich:treeNodesAdaptor > usage and sources for the given example.

- Prev6.9.2. < rich:treeNode > ...
- Top of page
- Front page
- Next6.9.4. < rich:recursiveTreeNodesAdaptor ...