You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ashish Raniwala <ar...@gmail.com> on 2005/01/09 14:58:33 UTC
Tapestry Tree Component
Guys,
I am working on Tree component and have a requirement to retrieve child nodes from database only if user expand parent node. To do this I need to get the selected node of the tree.
I expected that SimpleTreeStateModel.getSelectedNode() method should provide me the currently selected node ID so I could modify my data model in ITreeSessionStateManager.getModel() method. BUT instead of currently selected node id I always get previously selected node id from SimpleTreeStateModel.getSelectedNode() e.g. if I select node with NodeId = "1" and then I select node with NodeId = "5" then I get SimpleTreeStateModel.getSelectedNode() = "1".
On the other hand ITreeStateListener.treeStateChanged method gives selected node id correctly (using TreeStateEvent) but that is of no use for me as treeStateChanged is called AFTER getModel method of ITreeSessionStateManager so I can not provide modified model to tree component ?
Any ideas to solve this problem is appreciated.
Thanks,
Ashish