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.2.  < rich:treeNode > available since 3.0.0

expand all
6.9.2.1. Description
6.9.2.2. Key Features
6.9.2.3. Details of Usage
6.9.2.4. Built-in Drag and Drop
6.9.2.5. Events Handling
6.9.2.6. Reference Data
6.9.2.7. Relevant Resources Links

The <rich:treeNode> component is designed for creating sets of tree elements within a <rich:tree> component.


The "icon" , "iconCollapsed" , "iconExpanded" , "iconLeaf" attributes define icons for the component. Also you can define icons using facets with the same names. If the facets are defined, the corresponding attributes are ignored and facets contents are used as icons. The width of a rendered facet area is 16px.


...
<rich:tree ...>
        ...
        <rich:treeNode>
                <f:facet name="icon">
                    <outputText value="A"/>
                </f:facet>
                <f:facet name="iconCollapsed">
                    <outputText value="B"/>
                </f:facet>      
                <f:facet name="iconExpanded">
                    <outputText value="C"/>
                </f:facet>
                <f:facet name="iconLeaf">
                    <outputText value="D"/>
                </f:facet>
        </rich:treeNode>
        ...
</rich:tree>
...

As it has been mentioned above, <rich:treeNode> defines a template for nodes rendering in a tree. Thus, during XML document rendering (a web.xml application) as a tree, the following nodes output (passed via var="data" on a tree) happens:

Example:


...
<rich:tree faceNode="simpleNode" value="#{bean.data}" var="data">
        <rich:treeNode type="simpleNode">
                <h:outputText value="context-param:"/>
                <h:inputText value="#{data.name}"/>
        </rich:treeNode>
</rich:tree>
...

Hence, <h:outputText /> tag outputs the "context-param" string and then the <h:inputText /> outputs the data.name element of this node.

Different nodes for rendering could be defined depending on some conditions on the tree level. Each condition represents some rendering template. To get more information on various treeNodesAdaptorAdaptor definition for nodes, see the tree component chapter.

Switching between expanded/collapsed modes is also managed on the tree level and defined in the corresponding section.

Default nodes of the tree level as well as the ones defined with the treeNodesAdaptorAdaptor component could send Ajax requests when selected with the mouse, it's managed with the "ajaxSubmitSelection" attribute (true/false).

Information about the "process" attribute usage you can find " Decide what to process " guide section.

The main information on Drag and Drop operations is given in the corresponding paragraph of the tree component chapter. It's only necessary to mention that each node could also be a Drag element as well as a Drop container, i.e. the container and the element have all attributes, listeners and ways of behavior similar to the ones of the <rich:dragSupport > and <rich:dropSupport > components simultaneously.

Just as Drag and Drop operations it corresponds to the one described on the tree component level for a default Node.

Table of <rich:treeNode> attributes.





You can find all necessary information about style classes redefinition in
Definition of Custom Style Classes section.

How to Expand/Collapse Tree Nodes from code see in thiswiki article.