Package org.zkoss.zk.ui.util
Interface InitiatorExt
- All Known Implementing Classes:
Composition,GenericInitiator
public interface InitiatorExt
An extra interface that can be implemented with
Initiator to
have the better control.- Since:
- 3.0.0
- Author:
- tomyeh
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoiddoAfterCompose(Page page, Component[] comps) Called after all components are created (a.k.a., composed), and before any event is processed.booleanCalled when an exception occurs during the evaluation of the page.voidDo the cleanup after the page has been evaluated.
-
Method Details
-
doAfterCompose
Called after all components are created (a.k.a., composed), and before any event is processed.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 same asInitiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>)'s page argument.comps- the root components being created (never null, but the length might be zero). Note: It is not necessary the same asPage.getRoots(), since this method might be called thruExecutions.createComponents(java.lang.String, org.zkoss.zk.ui.Component, java.util.Map<?, ?>).- Throws:
Exception- Since:
- 3.0.0
-
doCatch
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(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>).- Parameters:
ex- the exception being thrown- Returns:
- 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 be ignored 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
- Throws:
Exception
-
doFinally
Do the cleanup after the page has been evaluated. It won't be called ifInitiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>)throws an exception. However,it is always called no matter whetherdoCatch(java.lang.Throwable)is called.An exception thrown in this method is simply logged. It has no effect on the execution.
- Throws:
Exception
-