Hi all,
I am trying to understand how to use the DBTreeView to work with 3 levels. I can show the data with no problem but there is a problem with the third level when I click on it because it is not returning the right record id for it. I tried different forms to do the setNRelationName. The one running now shows the correct info in the tree but the setCallBackInfo method returns the id of the first level, the id of the second one and repeats the second id in the third one:
var myselected = []
myselected = elements.dbtreeview_1.getSelectionPath()
application.output(myselected)
{EASTC,10400,10400}
This is the initialization code for the DBTreeView:
elements.dbtreeview_1.addRoots(foundset)
elements.dbtreeview_1.setTextDataprovider(controller.getDataSource(), 'companyname');
elements.dbtreeview_1.setNRelationName(controller.getDataSource(), 'customers_to_orders');
elements.dbtreeview_1.setTextDataprovider(databaseManager.getDataSource('example_data', 'orders'),'orderid')
elements.dbtreeview_1.setNRelationName(databaseManager.getDataSource('example_data', 'orders'),'orders_to_order_details');
// elements.dbtreeview_1.setNRelationName(databaseManager.getDataSource('example_data', 'order_details'),'customers_to_orders.orders_to_order_details');
elements.dbtreeview_1.setTextDataprovider(databaseManager.getDataSource('example_data', 'order_details'),'unitprice')
//set the method to call and dataprovider value to pass when node clicked
elements.dbtreeview_1.setCallBackInfo(controller.getDataSource(), rootselected,'companyname');
elements.dbtreeview_1.setCallBackInfo(databaseManager.getDataSource('example_data', 'orders'),mediumselected,'orderid')
elements.dbtreeview_1.setCallBackInfo(databaseManager.getDataSource('example_data', 'order_details'),thirdselected,'productid');
Any sample on how to use this control will help.
Thanks!