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

    rich:recursiveTreeNodesAdaptor calling roots collection exce

    Anders Norgaard Newbie


      I have a tree

      <rich:tree switchType="ajax">
       <rich:recursiveTreeNodesAdaptor roots="#{taskhistorymanager.historyTree()}" var="task">
       <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>

      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?