| org.zkoss.zk.ui.util.Initiator
All known Subclasses: org.zkoss.zkplus.databind.AnnotateDataBinderInit, org.zkoss.zk.ui.impl.ZScriptInitiator,
Method Summary | |
public void | doAfterCompose(Page page) Called after all components are created (aka., composed),
and before any event is processed.
Note: if
InitiatorExt is also implemented,
this method won't be called. | public boolean | doCatch(Throwable ex) Called when an exception occurs during the evaluation of the page.
If you don't want to handle the exception, simply returns false.
boolean doCatch(Throwable ex) {return false;}
An exception thrown in this method is simply logged. | public void | doFinally() Do the cleanup after the page has been evaluated.
It won't be called if
Initiator.doInit throws an exception.
However,it is always called no matter whether
Initiator.doCatch is called.
An exception thrown in this method is simply logged. | public void | doInit(Page page, Object[] args) Does the initializes before the page is evaluated. |
doAfterCompose | public void doAfterCompose(Page page) throws Exception(Code) | | Called after all components are created (aka., composed),
and before any event is processed.
Note: if
InitiatorExt is also implemented,
this method won't be called. Rather,
InitiatorExt.doAfterCompose will be called instead.
For example, the data-binding managers could process the binding
at this callback.
It won't be called if an un-caught exception occurs when creating
components.
Parameters: page - the page that new components are attached to. It is the sameas Initiator.doInit's page argument. |
doCatch | public boolean doCatch(Throwable ex) throws Exception(Code) | | Called when an exception occurs during the evaluation of the page.
If you don't want to handle the exception, simply returns false.
boolean doCatch(Throwable ex) {return false;}
An exception thrown in this method is simply logged. It has no
effect on the execution.
If you want to ignore the exception, just return true.
Notice: this method won't be called if the exception occurs
in
Initiator.doInit .
Parameters: ex - the exception being thrown whether to ignore the exception. If false is returned,the exception will be re-thrown.Note: once an initiator's doCatch returns true, the exception will beignored and it means doCatch of the following initiators won't be called.Prior to ZK 3.0.0, void is returned and it means always re-thrown |
doFinally | public void doFinally() throws Exception(Code) | | Do the cleanup after the page has been evaluated.
It won't be called if
Initiator.doInit throws an exception.
However,it is always called no matter whether
Initiator.doCatch is called.
An exception thrown in this method is simply logged. It has no
effect on the execution.
|
doInit | public void doInit(Page page, Object[] args) throws Exception(Code) | | Does the initializes before the page is evaluated.
Note: when it is called,
Page.getDesktop ,
Page.getId and
Page.getTitle all return null, since
the page is not initialized yet.
To get the current desktop, you have to use
org.zkoss.zk.ui.Execution.getDesktop (from
org.zkoss.zk.ui.Executions.getCurrent ) instead.
On the other hand, you can set the page's ID, title or style in
this method (to override the declarations in the page definition)
by
org.zkoss.zk.ui.Page.setId ,
Page.setTitle and
Page.setStyle .
In additions,
Page.getRequestPath and
Page.getAttribute are all available.
Parameters: page - the page being evaluated Parameters: args - an array of arguments passed withthe arg0, arg1, arg2 and arg3 attributes (of the init directive).If no argument is specified, args is an array with zero length. |
|
|