Class GenericInitiator
- All Implemented Interfaces:
Initiator,InitiatorExt
- Since:
- 5.0.5
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoAfterCompose(Page page) It is used only for backward compatibility.voiddoAfterCompose(Page page, Component[] comps) Called after all components are created (a.k.a., composed), and before any event is processed.booleanDoes nothing but returns false so the exception will be thrown.voidDo the cleanup after the page has been evaluated.voidDoes the initializes before the page is evaluated.
-
Constructor Details
-
GenericInitiator
public GenericInitiator()
-
-
Method Details
-
doInit
Description copied from interface:InitiatorDoes the initializes before the page is evaluated.Note: when it is called,
Page.getDesktop(),Page.getId()andPage.getTitle()all return null, since the page is not initialized yet. To get the current desktop, you have to useExecution.getDesktop()(fromExecutions.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) byPage.setId(java.lang.String),Page.setTitle(java.lang.String)andPage.setStyle(java.lang.String). In additions,Page.getRequestPath()andPage.getAttribute(java.lang.String, int)are all available.- Specified by:
doInitin interfaceInitiator- Parameters:
page- the page being evaluatedargs- a map of arguments. Prior to 3.6.2, it is an array. To upgrade, use args.get("arg0") instead of args[0], args.get("arg1") instead of args[1] and so on. Of course, it is better to have a more meaningful name for each argument. If no argument is specified, args is an empty map (never null).- Throws:
Exception
-
doAfterCompose
Description copied from interface:InitiatorExtCalled 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.
- Specified by:
doAfterComposein interfaceInitiatorExt- 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
-
doAfterCompose
It is used only for backward compatibility. Don't use it. -
doCatch
Does nothing but returns false so the exception will be thrown.- Specified by:
doCatchin interfaceInitiatorExt- 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
Description copied from interface:InitiatorExtDo 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 whetherInitiatorExt.doCatch(java.lang.Throwable)is called.An exception thrown in this method is simply logged. It has no effect on the execution.
- Specified by:
doFinallyin interfaceInitiatorExt- Throws:
Exception
-