4 Replies Latest reply on Aug 2, 2007 6:15 AM by kewldude

    big rich:tree : big delay

    Orsier Adrien Newbie


      I'm currently using a rich:tree to display some 'Topics'.
      Everything is working fine and nicely, except that I'm having over than 12,000 topics in my database.
      When I expand my 'root topic', which contain them all, it takes up to 35seconds to display them, with a "A script on the page may be busy, or it may have stopped responding. You can stop the script nor, or you can continue, to se if the script will continue" message in the middle of the processing. The direct children of 'root' are 'only' about 700.

      Then, when I'm clicking to expand one of my nodes, I takes about 5 seconds to display its children, and 5 seconds to 'unexpand' them. My tree switch_type is ajax, since in client mode the browser can simply not load the tree.

      Here's some simple code about it, although there's nothing special in it:

      <rich:tree switchType="ajax" style="width:300px" value="#{arbre.data}" var="item" nodeFace="#{item.type}">
       <rich:treeNode type="topic">
       <a4j:commandLink action="#{topicManager.selectItem(item)}" reRender="bookList,selectedTopic">#{item.keycode} : #{item.name} - </a4j:commandLink>

      Note again that everything is working fine, except that it's working far too slowly.

      I'd just wanna know on what I could work to improve that.
      The main problem is that each ajax method to expand a node takes about 5seconds server-wise to process. It's really slow when you wanna expand a node with just one child.
      There's also the problem of the displaying of the first 700 nodes, which take about 35s, but it seems to be a client-side problem, dunno if there's much to do about it.

      Oh and about my code implementation, each topic owns a Map of topics (its children) and has its 'father topic' reference.