|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zkdemo.userguide.MainLayoutInit
public class MainLayoutInit
| Constructor Summary | |
|---|---|
MainLayoutInit()
|
|
| Method Summary | |
|---|---|
void |
doAfterCompose(Page page)
Called after all components are created (aka., composed), and before any event is processed. |
boolean |
doCatch(java.lang.Throwable ex)
Called when an exception occurs during the evaluation of the page. |
void |
doFinally()
Do the cleanup after the page has been evaluated. |
void |
doInit(Page page,
java.lang.Object[] args)
Does the initializes before the page is evaluated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MainLayoutInit()
| Method Detail |
|---|
public void doAfterCompose(Page page)
throws java.lang.Exception
InitiatorNote: if InitiatorExt is also implemented,
this method won't be called. Rather, InitiatorExt.doAfterCompose(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component[])
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.
doAfterCompose in interface Initiatorpage - the page that new components are attached to. It is the same
as Initiator.doInit(org.zkoss.zk.ui.Page, java.lang.Object[])'s page argument.
java.lang.Exception
public boolean doCatch(java.lang.Throwable ex)
throws java.lang.Exception
InitiatorIf 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.lang.Object[]).
doCatch in interface Initiatorex - the exception being thrown
java.lang.Exception
public void doFinally()
throws java.lang.Exception
InitiatorInitiator.doInit(org.zkoss.zk.ui.Page, java.lang.Object[]) throws an exception.
However,it is always called no matter whether Initiator.doCatch(java.lang.Throwable) is called.
An exception thrown in this method is simply logged. It has no effect on the execution.
doFinally in interface Initiatorjava.lang.Exception
public void doInit(Page page,
java.lang.Object[] args)
throws java.lang.Exception
InitiatorNote: 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
Execution.getDesktop() (from
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 Page.setId(java.lang.String), Page.setTitle(java.lang.String) and Page.setStyle(java.lang.String).
In additions, Page.getRequestPath()
and Page.getAttribute(java.lang.String, int) are all available.
doInit in interface Initiatorpage - the page being evaluatedargs - an array of arguments passed with
the arg0, arg1, arg2 and arg3 attributes (of the init directive).
If no argument is specified, args is an array with zero length.
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||