Interface Initiator

All Known Implementing Classes:
Composition, GenericInitiator, ZScriptInitiator

public interface Initiator
Implemented by an initiator that will be invoked if it is specified in the init directive.

<?init class="MyInit"?>

Once specified, an instance is created and doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>) is called before the page is evaluated.

If you'd like to intercept other activity, you could implement InitiatorExt too. Then, InitiatorExt.doAfterCompose(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component[]) is called after all components are created, and before any event is processed. In additions, InitiatorExt.doFinally() is called after the page has been evaluated. If an exception occurs, InitiatorExt.doCatch(java.lang.Throwable) is called.

A typical usage: starting a transaction in doInit, rolling back it in InitiatorExt.doCatch(java.lang.Throwable) and commit it in InitiatorExt.doFinally() (if InitiatorExt.doCatch(java.lang.Throwable) is not called).

Author:
tomyeh
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doInit(Page page, Map<String,Object> args)
    Does the initializes before the page is evaluated.