Take a look at the stuff I just checked in.  I believe the new
TreeWalker stuff now gives you the ability to set the expanded state
of tree nodes *before* rendering.  I haven't tested that aspect though
so let me know what you think.

Sean

On 1/31/06, Cristofer Weber <[EMAIL PROTECTED]> wrote:
> Hans, thanks for the explanations. I think there's another thing in my code
> that is not working because I get a NullPointerException when I try to call
> expandAll after building the tree data. When debugging the code I see a
> empty instance of HtmlTree class even after some iterations with buttons
> that expand e collapse the nodes.
>
> I will try to recreate the app in a simplified way to see what's wrong.
>
> thanks!
>
>
> Cristofer
>
> 2006/1/27, Hans Sowa <[EMAIL PROTECTED] >:
> > Hm
> >
> > I'm not sure wheter I understand you correctly. You don't need a action
> like commandlink, etc. For instance in the code where you provide the data
> for the tree you can call the function afterwards. This should work.
> >
> >
> >
> > 2006/1/27, Cristofer Weber < [EMAIL PROTECTED]>:
> > > Hi Hans! First, thanks.
> > >
> > > When I´ve created a page whith a commandLink this way works fine, but
> how can I call the expandAll method without an action like the commandLink?
> How can I load the page with the tree2 in the expanded state without start
> an event? I did'nt find examples or information.
> > >
> > > Thanks a lot.
> > >
> > > []'s
> > >
> > > Cristofer
> > >
> > >
> > > 2006/1/27, Hans Sowa < [EMAIL PROTECTED]>:
> > >
> > > > Hi Cristofer
> > > >
> > > > I know way which is also explain in the examples as I know (I think, I
> believe,..)
> > > >
> > > > First you have to to a binding to the tree2 component.
> > > >
> > > > <t:tree2 ... binding="#{ managed-been.tree}">
> > > >
> > > > Then you have to implement the following code in your managed bean:
> > > >
> > > > /** Reference to the tree. */
> > > >     private HtmlTree tree;
> > > >
> > > >  /**
> > > >      * @return Returns the tree.
> > > >      */
> > > >     public HtmlTree getTree() {
> > > >         return this.tree;
> > > >     }
> > > >
> > > >     /**
> > > >      * @param tree The tree to set.
> > > >      */
> > > >     public void setTree(final HtmlTree tree) {
> > > >         this.tree = tree;
> > > >     }
> > > >
> > > >     /**
> > > >      * Öffnet den gesamten Baum.
> > > >      *
> > > >      */
> > > >     public void expandAll() {
> > > >         this.getTree().expandAll();
> > > >     }
> > > >
> > > > So, with the expandAll fuction you can expand the whole tree.
> > > >
> > > > Hope this helps.
> > > >
> > > > best regards Hans
> > > >
> > > >
> > > > 2006/1/27, Cristofer Weber < [EMAIL PROTECTED]>:
> > > >
> > > > > Hi friends
> > > > >
> > > > > after some days using the examples, I'm trying to create a page with
> an expanded tree2 component, but I'm with some difficults to do so.
> > > > >
> > > > > My first try was a PhaseListener getting the ViewRoot and navigating
> to the tree2 component for send a expandAll message, but without success.
> > > > >
> > > > >
> > > > >
> > > > > Then, I create my TreeModel extending the TreeModelBase and after
> the load of my nodes I search for all leafNodes to send a expandPath using
> the getPathInformation for each node, also without success.
> > > > >
> > > > >
> > > > > In both tries the tree2 loads correctly, but in the collapsed state.
> > > > >
> > > > >
> > > > > I'm in the way or there's another way to do it?
> > > > >
> > > > >
> > > > > Thanks a lot!
> > > > >
> > > > >
> > > > > Cristofer
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > mfg Hans Sowa
> > > > mailto:[EMAIL PROTECTED]
> > >
> > >
> >
> >
> >
> > --
> > mfg Hans Sowa
> > mailto:[EMAIL PROTECTED]
>
>

Reply via email to