add onCheck event to ZK Checkbox component using JAVA
private Grid listGrid;
Checkbox checkbox = new Checkbox();
checkbox.setValue("value");
//checkbox.addForward(Events.ON_CHECK, "onModifySelectedList", null);
checkbox.addEventListener(Events.ON_CHECK, new EventListener()
{
public void onEvent( Event arg0 ) throws Exception
{
onModifySelectedList(arg0);
}
});
public void onModifySelectedList( Event event )
{
Checkbox checkbox = (Checkbox)event.getTarget();
if (checkbox.isChecked())
{
System.out.println("check box is checked");
}
else
{
System.out.println("check box is unchecked");
}
}
No comments:
Post a Comment