i need to compose a Tree object holding some same nodes. how can i do this? As far as i understand when i call the
addItem(…) method i pass some String to display as node title. Some object (of the Item type) it returned but i can’t use it to establish parent-child relations between nodes. So how can i distinguish the nodes w/ the same values in them?
Hi Alejandro!
Thanks for your reply. Let’s assume i need to insert the same values and make one of them parent for another. is the following will b a good solution 4 this?
tree.addItem("value 1");
tree.addItem("value 1");
tree.setParent("value 1", "value 1");
If not - than how can i achieve this? For more real-life case consider the situation when items w/ the same labels located in the different subtrees of the original tree.
Thanks!
In that case can set the captions for each item. For example:
tree.addItem("parent");
tree.addItem("child");
tree.setParent("child", "parent");
tree.setItemCaption("parent", "value 1");
tree.setItemCaption("child", "value 1");
So
parent and
child are the items IDs, and
“value 1” is used as caption for both items.