SmartClient Version: SNAPSHOT_v9.1d_2013-09-15/PowerEdition Deployment (built 2013-09-15)
Chrome Version 30.0/ FF Version 24.x
I'm attempting to use a PickListItem where the first child of the tree root has a fixed set of code defined nodes, but the second child of the root needs to fetch it's children from a DataSource. Something like your PickTree SmartGWT showcase example of two pick trees, Advertising and Category, but I only have room for one top level pick tree and so I'm trying to combine them into the first level of the pick tree.
Not fully shown here is that I have a ChangeHandler on pPickTreeItem in which I attempt to fetch the children of the favP leg, modify the treeP tree by adding the fetched data nodes as:
But this doesn't work and the tree selections of the fetch data done in the ChangeHandler never appear in pPickListItem.
Do you have an alternative suggestion, or see where I have gone wrong?
Chrome Version 30.0/ FF Version 24.x
I'm attempting to use a PickListItem where the first child of the tree root has a fixed set of code defined nodes, but the second child of the root needs to fetch it's children from a DataSource. Something like your PickTree SmartGWT showcase example of two pick trees, Advertising and Category, but I only have room for one top level pick tree and so I'm trying to combine them into the first level of the pick tree.
Code:
pPickTreeItem = new PickTreeItem(); pPickTreeItem.setTitle("Choose"); TreeNode myC1 = new TreeNode("Choice1"); TreeNode myC2 = new TreeNode("Choice2"); TreeNode bltIn = new TreeNode("Built In:", myC1, myC2); final TreeNode favP = new TreeNode("Favs:"); final TreeNode baseP = new TreeNode("root", bltIn, favP); final Tree treeP = new Tree(); treeP.setRoot(baseP); pPickTreeItem.setValueTree(treeP); pPickTreeItem.setDefaultValue("Favs:"); pPickTreeItem.addChangeHandler(new com.smartgwt.client.widgets.form.fields.events.ChangeHandler ()
Code:
TreeNode node = new TreeNode(record.getAttibuteAsString("Name")); node.setParentID( favP.getName() ); treeP.setRoot(baseP); // baseP has been changed thru favP above pPickTreeItem.setValueTree(treeP) pPickTreeItem.redraw();
Do you have an alternative suggestion, or see where I have gone wrong?
Comment