4 Replies Latest reply on Sep 22, 2007 3:40 PM by Maksim Kaszynski

    Event Tree Expand..

    nightiger Newbie

      I am using ?nodeSelectListener? !!

      It mounts the Tree before entering in the function of the event.

      I want that it always enters before in the function the Event.
      I want to moficiar the Nodes in this function!
      Has another one an event?

        • 1. Re: Event Tree Expand..
          nightiger Newbie

          Correction :

          I want to "modify" the Nodes in this function! *

          • 2. Re: Event Tree Expand..
            Maksim Kaszynski Apprentice

            I'm still uncertain, what is that you need.
            Could you please explain in detail.
            And attach the code snippet as well.

            • 3. Re: Event Tree Expand..
              nightiger Newbie

              My Tree initially without nothing inside

              <rich:tree style="width:10px" ajaxSubmitSelection="true" switchType="ajax" value="#{treeBean.data}" var="item" n
              odeFace="#{item.type}">
              
              <rich:treeNode changeExpandListener="#{treeBean.evtExpand}" type="negocioTO" icon="/images/email.gif" iconLeaf="/images/email.gif">
               <h:outputText id="primeiro" value="#{item.label}" />
              </rich:treeNode>
              

              Event = changeExpandListener !!!


              Code that goes in the data base to make a consultation, and places icons in tree ! (Event changeExpandListener)

              public String evtExpand(NodeExpandedEvent event){
               ItemFuncaoB = new TreeImpl();
               ItemFuncaoB.setLabel("iconnnnn");
               ItemFuncaoB.setParent(funcao);
               ItemFuncaoB.setType("icone");
               funcao.addChilImpl("naotemId", ItemFuncaoB);
              }
              

              funcao = child of tree !

              The problem is that it alone enters in the function of the event after having passed for ?getChild () and getChildren ()? of ?funcao?!

              Then mine tree not dumb nothing! never.
              I have that to enter in the function of the event before passing in ?getChild () and getChildren ()? of ?funcao?!

              • 4. Re: Event Tree Expand..
                Maksim Kaszynski Apprentice

                The simplest way is to define your own TreeNode implementation, and override getChildren method to support lazy loading.