Hi All,
I am using DBTreeView Bean in one of my sample solution in Servoy 4.0. In this solutions what i am doing, first initializing the tree then after that i am adding multiple nodes under parent node. but when i doing the same it is giving me following execption.
Wrapped java.lang.NullPointerException (D:\Servoy WorkSpace\TreeBeanSample\forms\Test\Test_methods.js#18)
> java.lang.NullPointerException
Here is my Code.
Form Method
function addNode()
{
controller.loadAllRecords();
controller.newRecord(true);
node_id = 100;
label_text = “New Test Node 1”;
parent_id = 2;
controller.loadAllRecords(); //This is the line 18 where it is returning the exception
controller.newRecord(true);
node_id = 101;
label_text = “New Test Node 2”;
parent_id = 2;
databaseManager.saveData();
elements.company_tree.refresh();
}
function onShow()
{
var _binding = elements.company_tree.createBinding(controller.getServerName(), controller.getTableName());
_binding.setNRelationName(‘node_to_node’);
_binding.setTextDataprovider(‘label_text’);
_binding.setMethodToCallOnClick(globals.onNodeClick, ‘label_text’);
controller.find();
parent_id = 0;
controller.search(true,true);
elements.company_tree.addRoots(foundset);
}
Please telling my it is giving me error.
Thanks
Prem