0 Replies Latest reply on Oct 23, 2008 8:54 AM by Anders Norgaard

    rich:recursiveTreeNodesAdaptor calling roots collection exce

    Anders Norgaard Newbie

      Hi,

      I have a tree

      <rich:tree switchType="ajax">
       <rich:recursiveTreeNodesAdaptor roots="#{taskhistorymanager.historyTree()}" var="task">
       <rich:treeNode>
       <table><tbody><tr>
       <td><h:outputText value="#{task.createdDate}"><f:convertDateTime pattern="yyyy-MM-dd H:mm:ss"/></h:outputText></td>
       <td><h:outputText value="#{task.status}"/></td>
       <td><h:outputText value="#{task.taskName}"/></td>
       </tr></tbody></table>
       </rich:treeNode>
       </rich:recursiveTreeNodesAdaptor>
      </rich:tree>
      


      and I find that the roots collection method "#{taskhistorymanager.historyTree()}" is called N+1 times, where N is the size of the collection returned.

      Is this on purpose?

      The reason I ask is that I would like to return an always updated list, so I would like to query the database on every refresh of the page. But the current situation with N+1 queries for every refresh is too much. Any ideas for a workaround?

      Best
      Anders