<?xml version='1.0' encoding='UTF-8'?>
<section>
  <sectioninfo>
    <keywordset>
      <keyword>treeNodesAdaptor</keyword>
      <keyword>rich:treeNodesAdaptor</keyword>
      <keyword>HtmltreeNodesAdaptor</keyword>
    </keywordset>
  </sectioninfo>

  <table>
    <title>Component identification parameters </title>
    <tgroup cols="2">
      <thead>
        <row>
          <entry>Name</entry>
          <entry>Value</entry>
        </row>
      </thead>
      <tbody>
        <row>
          <entry>component-type</entry>
          <entry>org.richfaces.TreeNodesAdaptor</entry>
        </row>
        <row>
          <entry>component-class</entry>
          <entry>org.richfaces.component.html.HtmlTreeNodesAdaptor</entry>
        </row>
        <row>
          <entry>component-family</entry>
          <entry>org.richfaces.TreeNodesAdaptor</entry>
        </row>
        <!--
		<row>
          <entry>renderer-type</entry>
          <entry>org.richfaces.EffectRenderer</entry>
        </row>
		-->
        <row>
          <entry>tag-class</entry>
          <entry>org.richfaces.taglib.TreeNodesAdaptorTag</entry>
        </row>
      </tbody>
    </tgroup>
  </table>

  <section>
    <title>Creating the Component with a Page Tag</title>
    <!--para>
      In order to create the simplest variant of <emphasis role="bold"><property>&lt;rich:treeNodesAdaptor&gt;</property></emphasis> on a page use the
      following syntax:
    </para-->
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
<rich:treeNodesAdaptor var="issue" nodes="#{model.issues}">
    <rich:treeNode>
        <h:commandLink action="#{project.click}" value="Project: #{project.name}" />
    </rich:treeNode>
    ... 
    <!-- Others nodes -->							
    ...
</rich:treeNodesAdaptor>
...]]></programlisting>
  </section>

  <section>
    <title>Creating the Component Dynamically Using Java</title>
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlTreeNodesAdaptor;
...
HtmlTreeNodesAdaptor myTreeNodesAdaptor = new HtmlTreeNodesAdaptor();
...
]]></programlisting>
  </section>

  <section>
    <title>Details of Usage</title>
    <para>
      The <emphasis role="bold"><property>&lt;rich:treeNodesAdaptor&gt;</property></emphasis> component 
      has a <emphasis><property>&quot;nodes&quot;</property></emphasis> attribute that defines a collection of elements to iterate through.
    </para>
    <para>
      Collections are allowed to include lists, arrays, maps, XML NodeList and NamedNodeMap either as a single object. 
    </para>
    <para>
    The <emphasis><property>&quot;var&quot;</property></emphasis> attribute is used to access to the current collection element.
    </para>
    <para>
      The <emphasis role="bold"><property>&lt;rich:treeNodesAdaptor&gt;</property></emphasis> component can be nested without any limitations. 
      See the following example.  
    </para>
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
<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>
...]]></programlisting>

 </section>
  <section>
    <title>Relevant Resources Links</title>
    <para>
      <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/treeNodesAdaptor.jsf?c=treeNodesAdaptor"
      >Here</ulink> you can see the example of <emphasis role="bold"><property>&lt;rich:treeNodesAdaptor &gt;</property></emphasis> 
      usage and sources for the given example. </para>
  </section>    
</section>
