Search in sources :

Example 1 with CompleteConfirmHandler

use of org.openforis.collect.designer.util.MessageUtil.CompleteConfirmHandler in project collect by openforis.

the class SurveyErrorsPopUpVM method initEventListeners.

protected static void initEventListeners(Window popUp, final ConfirmHandler confirmHandler) {
    IdSpace idSpace = popUp.getSpaceOwner();
    Component okButton = Path.getComponent(idSpace, OK_BUTTON_ID);
    okButton.addEventListener(ON_CLICK_EVENT, new EventListener<Event>() {

        public void onEvent(Event arg0) throws Exception {
            confirmHandler.onOk();
        }
    });
    Component cancelButton = Path.getComponent(idSpace, CANCEL_BUTTON_ID);
    cancelButton.addEventListener(ON_CLICK_EVENT, new EventListener<Event>() {

        public void onEvent(Event arg0) throws Exception {
            if (confirmHandler instanceof CompleteConfirmHandler) {
                ((CompleteConfirmHandler) confirmHandler).onCancel();
            }
        }
    });
}
Also used : CompleteConfirmHandler(org.openforis.collect.designer.util.MessageUtil.CompleteConfirmHandler) Event(org.zkoss.zk.ui.event.Event) IdSpace(org.zkoss.zk.ui.IdSpace) Component(org.zkoss.zk.ui.Component)

Aggregations

CompleteConfirmHandler (org.openforis.collect.designer.util.MessageUtil.CompleteConfirmHandler)1 Component (org.zkoss.zk.ui.Component)1 IdSpace (org.zkoss.zk.ui.IdSpace)1 Event (org.zkoss.zk.ui.event.Event)1