PDA

View Full Version : refresh TreeNode's Label



davvid
21 Nov 2011, 5:26 AM
I need to refresh the label of a node when a child is checked (for exemple put a bold label).
This update works only when I manually extend/collapse the node.
I tried udpate() and other methods but whitout results.
How can i automatically refresh this label ?
Thanks

catalin.ciobanu
21 Nov 2011, 5:28 AM
have you try layout() on the container ?
I've noticed when I make a change which is VISIBLE in UI, usually it needs the parent to layout() to become visible.

davvid
21 Nov 2011, 7:02 AM
Thanks for your answer.
I tried it, but it doesn't work.

A.Rothe
22 Nov 2011, 6:21 AM
I have the same problem with a new icon. I can set the a value within the ModelData, but the IconProvider doesn't refresh the icon on the tree. As work-around I remove the ModelData and add it again to the store. This refreshes the icon. Maybe it helps on your problem too.

~André

sven
22 Nov 2011, 6:37 AM
treeStore.update(model) should work in theses cases. I am using it all over the place

davvid
22 Nov 2011, 6:39 AM
Thanks.
For the moment, I solved the problem with collapsing and extending the node in the CheckChangedListener.
But I think that a better solution exists.

davvid
22 Nov 2011, 7:08 AM
Thanks sven. This works

A.Rothe
22 Nov 2011, 7:31 AM
treeStore.update(model) should work in theses cases. I am using it all over the place

This refreshes the icon too, thanks!
~André