Friday, 25 May 2012

ZK Check Event Handling Using MVC



<?page title="new page title" contentType="text/html;charset=UTF-8"?>
    <window title="new page title" border="normal" apply="mypack.CheckBoxController">
        <checkbox id ="showActive" label="Show only active" />
        <separator />
            You have selected :
            <label id="Active" />

package mypack;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.InputEvent;
import org.zkoss.zul.Label;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Messagebox;
public class CheckBoxController extends GenericForwardComposer {
    private Label Active;
    private Checkbox showActive;
    public void onCheck$showActive(Event event) {
        if (showActive.isChecked() == true)
            Active.setValue("You have selected to show Only Active ");
            Active.setValue("You have selected to show All");

No comments:

Post a Comment