6 Replies Latest reply on Mar 10, 2011 7:06 AM by nimo stephan

    rich:treeModelAdaptor iterating arrays

    nimo stephan Master

      Can I use a simple Collection (List) of Objects for a rich:tree ?

       

       

      {quote}The <rich:treeModelAdaptor> component takes an object which implements the Map or Iterable interfaces. It adds all the object entries to the parent node as child nodes .{quote}

       

       

       

      <rich:tree>

       

      <rich:treeModelAdaptor id="project" nodes="#{bean.list}"

      var="i">

       

      <rich:treeNode>

      #{i.name}

      </rich:treeNode>

       

      </rich:treeModelAdaptor>

       

      </rich:tree>

       

      does not work. The iteration occurs, but I do not see the #{i.name} of a leave. However, i.name is a simple string.

       

      By the way, the docs in http://docs.jboss.org/richfaces/latest_4_0_X/Component_Reference/en-US/html_single/#chap-Component_Reference-Trees section Example 12.4. Nested <rich:treeModelAdaptor> components uses the old <rich:treeNodesAdaptor instead of rich:treeModelAdaptor.