Hi i too am facing this problem.
When i refresh the page the tree collapses to its original state.
Please guide me how to solve this
Thanks
Prati
CrocodileShoes wrote:
I've finally got this working by extending DefaultTreeState and overriding
the isNodeSelected to calculate the selection
Thanks for the info, James. I've read through the api and the tutorial on
the sun site but am not much closer to finding a solution.
Perhaps if I explain the full case somebody might have some advice. I'm
also considering whether a tree is the best structure.
I have a wicket model that wraps
I've finally got this working by extending DefaultTreeState and overriding
the isNodeSelected to calculate the selection based upon the wicket model
containing the data. This makes more sense since the tree's state is
representative of the actual data now!
--
View this message in context:
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
You should not recreate the TreeModel and for most cases DefaultTreeModel is
what you want. If you are adding a node, add it with: