0 Replies Latest reply on Aug 2, 2012 7:45 AM by Ionut Nedelcu

    The recursive tree model adapter loads nodes multiple times

    Ionut Nedelcu Newbie

      Hello,

       

      I have an issue with richfaces trees. I am using the rich:treeModelRecursiveAdaptor. The JSF code is something like this

       

      <rich:tree var="item" toggleType="ajax>

           <rich:treeModelRecursiveAdaptor roots="#{myBean.roots}" nodes="#{item.children}">

                <rich:treeNode>#{item.name}</rich:treeNode>

           </rich:treeModelRecursiveAdaptor>

      </rich:tree>

       

      The problem is that even when the page is loaded, the getRoots() method gets called twice. And when I start expanding nodes, there are even more calls to getRoots() and getChildren(). The tree does display ok, but there is a lot of redundant function calls. Has anyone experienced this?

       

      Another question would be wether on a node expansion (with ajax toggle), the tree just calls getChildren() for the node in question, or does it do that for a larger portion of that tree ?