You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Thomas Artner <ar...@gmx.com> on 2005/08/22 15:28:00 UTC
tree state clear/reset
Hi!
I am using the myfaces tree component. It works well but now I would like to
replace the rootnode after pressing a button in my app.
On pressing the button I do a
tree = (TreeModel) new Tree_Model(new Long(text));
The Tree_Model(new Long(text)) generates a new TreeModel with a new
RootNode.
That works too - but if there are some nodes expanden before i "replace" the
tree I always get exceptions.
It seems that the "state" (which node is collapsed and which node is
expanded) will be applied to the new tree. And this can't work.
my Question: Where is the "state" saved? How can i "reset" the
tree-component that it forgets which nodes should be collapsed and which
should be expanded?
Greeting,
Tom
Re: Antwort: tree state clear/reset
Posted by Sean Schofield <se...@gmail.com>.
It is recommended that you use tree2 at this time because most of our
users are familiar with that version. IMO it is more flexible then
the first tree but then again, I wrote it so I am biased.
sean
On 8/22/05, Thomas Artner <ar...@gmx.com> wrote:
> > --- Ursprüngliche Nachricht ---
> > Von: mathias.werlitz@daimlerchrysler.com
> > An: users@myfaces.apache.org
> > Betreff: Antwort: tree state clear/reset
> > Datum: Mon, 22 Aug 2005 15:38:40 +0200
> >
> > What version of myfaces and of the tree component do you use <t:tree> or
> > <t:tree2>?
> >
>
> I am using <t:tree> and myfaces 1.0.9
>
>
>
>
> > artner@gmx.com schrieb am 22.08.2005 15:28:00:
> >
> > > Hi!
> > >
> > > I am using the myfaces tree component. It works well but now I would
> > like to
> > > replace the rootnode after pressing a button in my app.
> > > On pressing the button I do a
> > > tree = (TreeModel) new Tree_Model(new Long(text));
> > >
> > > The Tree_Model(new Long(text)) generates a new TreeModel with a new
> > > RootNode.
> > >
> > > That works too - but if there are some nodes expanden before i "replace"
> > the
> > > tree I always get exceptions.
> > >
> > > It seems that the "state" (which node is collapsed and which node is
> > > expanded) will be applied to the new tree. And this can't work.
> > >
> > > my Question: Where is the "state" saved? How can i "reset" the
> > > tree-component that it forgets which nodes should be collapsed and which
> > > should be expanded?
> > >
> > >
> > > Greeting,
> > > Tom
> >
>
Re: Antwort: tree state clear/reset
Posted by Thomas Artner <ar...@gmx.com>.
> --- Ursprüngliche Nachricht ---
> Von: mathias.werlitz@daimlerchrysler.com
> An: users@myfaces.apache.org
> Betreff: Antwort: tree state clear/reset
> Datum: Mon, 22 Aug 2005 15:38:40 +0200
>
> What version of myfaces and of the tree component do you use <t:tree> or
> <t:tree2>?
>
I am using <t:tree> and myfaces 1.0.9
> artner@gmx.com schrieb am 22.08.2005 15:28:00:
>
> > Hi!
> >
> > I am using the myfaces tree component. It works well but now I would
> like to
> > replace the rootnode after pressing a button in my app.
> > On pressing the button I do a
> > tree = (TreeModel) new Tree_Model(new Long(text));
> >
> > The Tree_Model(new Long(text)) generates a new TreeModel with a new
> > RootNode.
> >
> > That works too - but if there are some nodes expanden before i "replace"
> the
> > tree I always get exceptions.
> >
> > It seems that the "state" (which node is collapsed and which node is
> > expanded) will be applied to the new tree. And this can't work.
> >
> > my Question: Where is the "state" saved? How can i "reset" the
> > tree-component that it forgets which nodes should be collapsed and which
> > should be expanded?
> >
> >
> > Greeting,
> > Tom
>
Antwort: tree state clear/reset
Posted by ma...@daimlerchrysler.com.
What version of myfaces and of the tree component do you use <t:tree> or
<t:tree2>?
artner@gmx.com schrieb am 22.08.2005 15:28:00:
> Hi!
>
> I am using the myfaces tree component. It works well but now I would
like to
> replace the rootnode after pressing a button in my app.
> On pressing the button I do a
> tree = (TreeModel) new Tree_Model(new Long(text));
>
> The Tree_Model(new Long(text)) generates a new TreeModel with a new
> RootNode.
>
> That works too - but if there are some nodes expanden before i "replace"
the
> tree I always get exceptions.
>
> It seems that the "state" (which node is collapsed and which node is
> expanded) will be applied to the new tree. And this can't work.
>
> my Question: Where is the "state" saved? How can i "reset" the
> tree-component that it forgets which nodes should be collapsed and which
> should be expanded?
>
>
> Greeting,
> Tom