//the checking
if (hasEvent(peer, inputForm))
{
Checkbox cbox = (Checkbox) peer.getComponent();
cbox.setState(!cbox.getState()); //toggle the checkbox
postEvent(context, new ItemEvent(cbox, ItemEvent.ITEM_STATE_CHANGED, cbox, cbox.getState()
? ItemEvent.SELECTED
: ItemEvent.DESELECTED));
} else if (hasGroupEvent(peer, inputForm))
{
Checkbox cbox = (Checkbox) peer.getComponentObject();
CheckboxGroup grp = cbox.getCheckboxGroup();
/*
* should not need to fire unselection Checkbox selected = grp.getSelectedCheckbox(); context.getEventQueue().postEvent(
* new ItemEvent(selected, ItemEvent.ITEM_STATE_CHANGED, selected, ItemEvent.DESELECTED));
*/
grp.setSelectedCheckbox(cbox);
postEvent(context, new ItemEvent(cbox, ItemEvent.ITEM_STATE_CHANGED, cbox, ItemEvent.SELECTED));
}
}