5 Replies Latest reply on Jun 20, 2008 4:36 PM by Francisco Jose Peredo Noguez

    Rich Tree

    kanwar sangha Newbie

      Hi,


      We are using the richfaces tree control for building a tree based navigation. Is there any support provided for auto-refresh when a node is deleted from the tree ?


      We were able to bind the node selection with the View on the right side , but when we delete the child node , is there any way to refresh only the opened tree parent node ?


      Thanks,
      Kanwar

        • 1. Re: Rich Tree
          Roberson Ribeiro Newbie

          Hi,


          You could bind your entire rich:tree with UITree component from richfaces package. For example.


          Create a seam component UITreeBean of SESSION scope. Define a org.richfaces.component.UITree member with it's getter and setter and finally binds your rich:tree with this member. So every change you make in your tree it's gonna be reflected in your page.



          <rich:tree binding="#{uiTreeBean.yourUITree}" />
          


          • 2. Re: Rich Tree
            kanwar sangha Newbie

            Thanks for your reply.


            The tree should work like a windows explorer. When i delete a node on the right side of the screen, the node which was shown in the tree should automatically get deleted.


            All operations (add/delete) happen in the right frame and not on the tree component.


            Example -


            Tree Frame     View Frame
            ----------------------------------------
            Root          root1 page will be shown when
              
                      "root1" is selected from the tree
              
            - root1
              
            - root2
                       

            ----------------------------------------


            Now if i delete root1 from the delete action in the root1 View Page,how does the root1 in the tree get deleted ?


             

            • 3. Re: Rich Tree
              Roberson Ribeiro Newbie

              Hi,
              What about remove/add node by code in your delete/add action and refresh your tree frame. Or you could use DIV's instead of frames, things would be easier i think.


              Roberson

              • 4. Re: Rich Tree
                kanwar sangha Newbie

                If we refresh the tree frame, the state is lost. If i had some parent nodes open, it just collapses all...we need a way to save the current start and only refresh the opened node...