PDA

View Full Version : 3.3.x toggleCheck on TreeNodeUI only works if the node has been rendered?



Felicitus
16 Jan 2011, 10:57 AM
Hi,

I'm loading a tree and mark specific items as checked before the tree is displayed. However, it seems that toggleCheck only works if the node already has been rendered.

This should be fixed to support checking TreeNodeUI works without being rendered.

If this is already fixed for 4.0, perfect :)

Thanks,
Timo

Condor
16 Jan 2011, 11:42 PM
This is more a feature request than a bug report. 'toggleCheck' was never meant to be used as generic 'setChecked' method.

Felicitus
17 Jan 2011, 4:34 AM
I disagree that this is a feature request. The documentation for TreeNodeUI.toggleCheck() does not indicate that this method was never meant as a generic setChecked() method.

In fact, even if this was never meant as a setChecked method and if you removed it, you would make things even worse, as there would be no way to manipulate the tree before it is rendered. TreeNodeUI.toggleCheck() should work as documented.

Additionally, a feature request would be to add a setChecked() method, which might not check the box directly, but rather some checked property so it can be displayed correctly when rendered.