You should not recreate the TreeModel and for most cases DefaultTreeModel is
what you want. If you are adding a node, add it with:

http://java.sun.com/javase/6/docs/api/javax/swing/tree/DefaultTreeModel.html#insertNodeInto(javax.swing.tree.MutableTreeNode,%20javax.swing.tree.MutableTreeNode,%20int)

which will notify all the listeners, such as the wicket tree

On Wed, Apr 22, 2009 at 10:56 AM, CrocodileShoes <mark.do...@logica.com>wrote:

>
> I have the same problem but with a different tree use case.  I'm
> implementing
> a facet search which needs to update the tree after a user selects a tree
> node (facet).  If I recreate the tree model like you were doing it doesn't
> persistent the selection, obviously.
>
> I'm not experienced with Swings trees but I think I may have to implment my
> own TreeModel.
>
> Does anybody have the solution for this?
>
>
> jchappelle wrote:
> >
> > I have a TreeTable and I have links within it. When a user clicks a link
> > they are presented with a modal window with a FileUpload component in it.
> > When they upload a new file and click close on the modal window, the
> > TreeTable is not updated. I tried to use a LoadableDetachableModel that
> > returns a DefaultTreeModel but if I do that then every time I click to
> > expand a folder node the tree refreshes the model and the tree state and
> > the icon doesn't expand(i'm guessing it's because the treestate gets
> > recreated?).
> >
> > I searched but couldn't find anyone with this specific problem in the
> > forum. Can someone please help?
> >
> > I am using wicket 1.3.4.
> >
> > Thanks,
> >
> > Josh
> >
>
> --
> View this message in context:
> http://www.nabble.com/Dynamically-update-TreeTable-model-tp21056846p23175533.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Jim McLaughlin
Lead Software Engineer
Stonewater Control Systems
(o) 847.864.1060 x107
(c) 773.416.0994

Reply via email to