I have a vbox with some checkboxes in it, like so:
<vbox id="myVbox" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('my.checkbox.group.CheckboxGroupViewModel', outerVM=wvm, component=self)">
<checkbox id="1"/>
<checkbox id="2"/>
<checkbox id="3"/>
</vbox>
Is there a way to make the vbox react to any of its children's onCheck event?
Edit:
The vbox is part of a window that has its on viewmodel. In it, there is the following code to add the radios dynamically:
if (childName.equals("org.zkoss.zul.Checkbox")) {
child.addEventListener("onClick", new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
Events.sendEvent(new Event("onSelectionChange",parent));
}
});
}
The parent variable represents the vbox. The viewmodel of the vbox contains an onSelectionChange method. But it seems to never get called.