6 Replies Latest reply on May 28, 2009 9:50 AM by Derk Dukker

    Rich Tree maximum amount of nodes is 14765?

    Derk Dukker Novice

      Hi all,

      I have a web app with a rich tree in client mode. I fill this tree with data comming from a webservice. the data itself is in application scope. I just want to retrieve all the data once and let every user make use of that same data. But when loading the page the logging stucks on 14765 nodes :(
      It looks like the rich tree has a maximum of 14765 nodes, is that correct?
      Also I want to expand a tree node automaticly when a GET parameter is set.
      With a button it worked but with the get parameter it doesn't. It seams to me that the tree doesn't re-render when queuNodeExpand is called during load. With the button I can say re-render the tree and that works. Is there a way to force a re-render in code?

      If the maximum amount of nodes is reached, is it possible to load all the data in memory and query the data somehow? I know I can solve this by not getting all the data once but uses steps and make use of AJAX but that's not the preferred option.

        • 1. Re: Rich Tree maximum amount of nodes is 14765?
          Derk Dukker Novice

          Forgot to tell that I'm using seam 1.2.1 with richfaces 3.1.6SR1 on an oracle application server 10.1.3.4 with 1024mb jvm memory.

          I can't upgrade to Seam 2 because oracle AS 10.1.3.4 doesn't support jsf 1.2

          • 2. Re: Rich Tree maximum amount of nodes is 14765?
            Nick Belaevski Master

            Hi,

            There is no artificial limit. Are there any exceptions/errors in server log/console? How do you know that the particular number of nodes is output?

            • 3. Re: Rich Tree maximum amount of nodes is 14765?
              Derk Dukker Novice

              Thanks for your respond. Well I have set a counter, so for every node I add I do a plus 1 to the counter in the log. Everytime it stops at 14765, I don't see any errors in the logs. It just stops :(

              • 4. Re: Rich Tree maximum amount of nodes is 14765?
                Ilya Shaikovsky Master

                you creating just tree model structure.. it knows nothing about tree control which will render this structure on the page.. So the problem seems just during your data fetching..

                about tree initial expansion - try to use advisors as it shown at demosite.

                • 5. Re: Rich Tree maximum amount of nodes is 14765?
                  Derk Dukker Novice

                  I think when the tree is in switchType client with this amount of nodes the client is not able to build up the tree within a reasonable amount of time. putting the tree in server mode, the tree displays fine.

                  the only question I have now is how can I expand the tree to a particular node when the page has got a GET parameter in the url.
                  I bind the tree to my bean and use the walk method. In the log I see that it matches the node and also telling me the rowkey to be expanded. But the tree doesn't expand. This same mechanism works when using a a4j commandbutton with the re-render option. Does anybody have an idea how to solve this issue?

                  I have now this:

                  ...
                  @RequestParameter("beroep_cd") private Long beroep_cd;
                  ...


                   @Begin(join = true)
                   public TreeNode getTreeNode() {
                   if (rootNode == null) {
                  
                   loadTree();
                  
                   }
                   if(beroep_cd != null){
                   openTreeNodes(beroep_cd);
                   }
                  
                   return rootNode;
                   }
                  
                  


                  <rich:tree id="treeSBC" style="width:300px"
                   switchType="server" value="#{SBCTreeBean.treeNode}" var="_sector"
                   nodeFace="#{_sector.type}" stateAdvisor="#{sbcStateAdvisor}" binding="#{SBCTreeBean.sbcTree}">
                   <rich:treeNode type="sbcBeroepNiveau" ajaxSubmitSelection="false">
                   <h:outputText value="#{_sector.omsSbcBeroepNiveau}"></h:outputText>
                   </rich:treeNode>
                   <rich:treeNode type="sbcBeroepKlasse" ajaxSubmitSelection="false">
                   <h:outputText value="#{_sector.omsSbcBeroepKlasse}"></h:outputText>
                   </rich:treeNode>
                   <rich:treeNode id="sbcBeroepGroepNodes" type="sbcBeroepGroep" iconLeaf="../a4j_3_1_6.SR1images/iconFolder.gif.seam">
                   <h:outputText value="#{_sector.omsSbcBeroepGroep}"></h:outputText>
                   </rich:treeNode>
                   <rich:treeNode id="hoofdBeroepenNodes" type="hoofdberoep" iconLeaf="../a4j_3_1_6.SR1images/iconFolder.gif.seam">
                   <h:outputText value="#{_sector.omsBeroepsnaam}"/>
                   </rich:treeNode>
                   <rich:treeNode id="beroepenNodes" type="beroep" ajaxSubmitSelection="false">
                   <a4j:commandLink id="beroepLink" action="#{zoekBeroepAction.retrieveBeroepRelatieEnd(_sector, true)}" oncomplete="registreer('#{zoekBeroepAction.beroepRelaties.cdBeroepsnaam}+#{zoekBeroepAction.beroepRelaties.omsBeroepsnaam}+#{_sector.cdBeroepsnaam}+#{_sector.omsBeroepsnaam}')" value="#{_sector.omsBeroepsnaam}"/>
                   <h:outputText id="whiteSpace" value="   " />
                   <a4j:commandLink id="beroepInfoLink" action="#{zoekBeroepAction.retrieveBeroepRelatie(_sector)}"
                   oncomplete="Richfaces.showModalPanel('informationLettercombinatieBeroepPanel');" reRender="selectedLettercombinatieBeroep">
                   <h:graphicImage id="information" style="border-width:0" value="../images/I.png" />
                   </a4j:commandLink>
                   </rich:treeNode>
                  
                   </rich:tree>
                  


                  @ilya_shaikovsky: I will also take a look at the stateAdvisor, I experiment with this earlier but then the queueNodeExpand method didn't seem to work. I will give it another try

                  • 6. Re: Rich Tree maximum amount of nodes is 14765?
                    Derk Dukker Novice

                    I tried to use the StateAdvisor but the stateAdvisor iterates only through the visible nodes. So no childs are being explored. Anyway I don't think it's faster then the walk() method of UITree...

                    So I guess I will have to use an AJAX way to speed up the tree :( (data model is less big) and walk over the tree with the walk() method of UITree.
                    Or is there another way to walk over 14765 nodes in less then a couple of seconds? Any ideas?