Hi Massimo,
children of collapsed nodes are not present in the Wicket component
hierarchy. I don't understand why you're getting different results
whether you want to select or deselect though.
Instead of twiddling with components, you should perform the mutation
directly on your model objects:
root.selectAll(true):
public void selectAll(boolean select) {
this.selected = select;
for (Foo child : children) {
child.selectAll(select);
}
}
Hope this helps
Sven
On 05/21/2011 08:45 AM, massimo_pugni wrote:
Hi,
now that all is looking fine I'm observing a strange behaviuor.
The same method, to 'check/uncheck' all from a button,
public void modifyAllCheckBoxes(final boolean select) {
visitChildren(CheckBox.class, new IVisitor<Component>() {
@Override
public Object component(Component component) {
CheckBox checkBox=(CheckBox)component;
checkBox.setModelObject(select);
return IVisitor.CONTINUE_TRAVERSAL;
}
});
}
seems not working when all are collapsed and if I want unselect all (the
select works).
1. Collapsing all and selecting all works
2. nodes into a branch can be unselected with the button only
after having
expanded and collapsed it
page is opened with the tree state = expanded by default
best
Massimo
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-checkboxes-managing-tp3472967p3540207.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]