How can I populate a Tree with objects ?

Hi All,

I should populate a Tree component with some objects.
I used tree.addItem(myObject) but when I don’t understand how to set the parent of this element.
I found some examples on internet, but the examples use String rather than Custom objects.
Any suggestion.
I’d like use Object in the Tree because I have to access some object properties when an user click on a tree node.
Cheers.

        Stefano

I used something like:

tree.addItem(myParentObject); tree.addItem(myObject); tree.setParent(myObject, myParentObject); and it works perfectly fine

Hi,

Thanks.
I dind’t get very well the way too populate a Tree…now everything is clear :slight_smile:
Cheers.

           Stefano