Mark Item as selected in TreeTable

Hi All,

in my application I have a TreeTable component which is filled by a custom implementation of Hierarchical. The TreeTable works quite nice, no problems so far.

Now I have the requirement to mark one entry in the TreeTable as selected. I tried to use TreeTable.setValue(), but until now this does not work.

Can anybody please tell me what I have to do to that the tree table expands and marks the item? Or maybe there is somewhere a demo application available, which shows how to set an item in a TreeTable as marked?

I use Vaadin 6.7.3.

Thank you in advance,

try the select(Object itemId) method

Hi Danny,

thanks for your hint.

select(Object itemId) seems to call internally setValue(Object itemId). My problem was I had to be careful what to set as itemId. I got a little bit mixed up with the BeanContainer and tried to set the Object instead of the itemId.

After setting the correct itemId it was neccessary to expand all nodes in the tree so the marked item in the TreeTable was visible.