Hi all,
This time i got a problem with DBTreeView refresh Data.
My initTreeView Method is like followig (which is reference to
http://forum.servoy.com/viewtopic.php?p=49925#49925)
var Binding = elements.dbtreeview.createBinding(controller.getServerName(), controller.getTableName());
//Replace X with the name of the relation that supplied the childNodes for a Node
Binding.setNRelationName(“section_to_section_parent_childs”);
//Replace X with the name of a dataprovider that returns the text for the node
Binding.setTextDataprovider(“displaynode”);
//Sets the global method that gets called when the node is clicked and replace X with the name of a dataprovider will be send as an argument into the globals.XXX method (note: no “()” behind “globals.XXXX”)
Binding.setMethodToCallOnClick(globals.glb_node_selected, “section_id”);
//elements.dbtreeview.createColumn(controller.getServerName(), controller.getTableName(), ‘Description’, ‘description’);
controller.find();
//column_x = “someValueHere”;
section_parent_id =‘^’;
controller.search(false,true);
//set the root node(s) and set the name of dataprovider to use for text display on a node
elements.dbtreeview.addRoots(foundset);
I called above initTreeView Method at the onShow action. and also i called it again after i save new record.
It’s going to refresh the treeview data but the problem is it place duplicate node accoding to last save parent id.
before i save the new record it show as the follwing,
-1
+2
+3
-4
+5
+6
after i save the new record and i re-called initTreeView method, it refresh data and place the duplicate data in treeview like the following,
-1
+2
+3
-4
+5
+6
+7
-4
+5
+6
+7
===========================================
if anybody have solution pls let me know how to do.
Thanks
Dennis