3 Replies Latest reply on Sep 4, 2009 5:54 PM by nbelaevski

    Controlling Nodes Expanded on tree & treeNode

    paulbotta

      I am using a rich:tree with rich:treeNode(s) and each time that the page is refreshed, the tree is collapsed to the root node. How can I display the tree with all (or at least some) of the nodes expanded by default?

      Thx.

        • 1. Re: Controlling Nodes Expanded on tree & treeNode
          nbelaevski

          Hi,

          You can use "adviseNodeOpened" attribute.

          • 2. Re: Controlling Nodes Expanded on tree & treeNode
            shadowcreeper

            I apologize if this is obvious and insulting your intelligence but it took me a bit of playing with it to figure it out...

            It will save state by default (returning null from the advice methods will tell it to use what it remembers) but you have to do some sort of ajax send in order for it to remember the state. If you just expand a few nodes via client-side javascript and hit refresh, it can't remember anything.

            • 3. Re: Controlling Nodes Expanded on tree & treeNode
              nbelaevski

               

              "shadowcreeper" wrote:
              I apologize if this is obvious and insulting your intelligence but it took me a bit of playing with it to figure it out...

              It will save state by default (returning null from the advice methods will tell it to use what it remembers) but you have to do some sort of ajax send in order for it to remember the state. If you just expand a few nodes via client-side javascript and hit refresh, it can't remember anything.


              That's right I've missed this point, thanks you for commenting on that!