View Full Version : How to update model in Asynchronous Tree
cdasher
04-24-2008, 02:48 PM
So, I have a TreeViewer which is loading my tree from the server and I have a form that adds a new object into the database, how do I notify the tree to get the latest info and refresh itself. Also, I would like to just update one node and I see the refresh methods and the find method on the viewer. What is the best way to accomplish this . If viewer.refresh(elem) is the right way, how do I get elem when I am on some other form, do I register the tree and then ask it for the selected item?
cdasher
04-24-2008, 04:38 PM
So I add a new item to my database and then call
viewer.refresh(tree.getSelectionModel());
viewer.update(tree.getSelectionModel());
and the FIRST time, it adds refreshes the tree with my new item , subsequent calls to the same do nothing...... any ideas?
darrellmeyer
04-24-2008, 04:50 PM
You should call refresh with the element who's children you want reloaded. You do not want to pass the selection model to refresh.
cdasher
04-24-2008, 04:53 PM
actually I tried that and it worked the same way, What I have found out which I (edit: thought I had but actually posted in the same help forum sorry) posted under bugs is that the FIRST time I add to the tree and expand it works. After that (once the tree is expanded) any other calls to refresh do nothing, even if I refresh and load eveything anew, I cannot get the refresh to work. By the way I am very impressed by the quick response time and I have already put in for a devleoper license and silver support. So thanks for helping in the Free forum.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.