|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Composer<T extends Component>
Represents a composer to initialize a component (or a component of tree) when ZK loader is composing a component. It is the controller in the MVC pattern, while the component is the view.
To initialize a component, you can implement this interface and then specify the class or an instance of it with the apply attribute as follows.
<window apply="my.MyComposer"/>
<window apply="${a_composer}"/>
Then, ZK loader will
ComposerExt.doBeforeCompose(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.metainfo.ComponentInfo)
, if the composer
also implements ComposerExt
.UiFactory.newComponent(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.metainfo.ComponentInfo, org.zkoss.zk.ui.Component)
, which creates
and initializes the component accordingly).
ComposerExt.doBeforeComposeChildren(T)
, if
ComposerExt
is also implemented.doAfterCompose(T)
after all children are, if any,
composed.To intercept the lifecycle of the creation of a page,
implement Initiator
and specify the class with the init directive.
Note: AfterCompose
has to be implemented
as part of a component, while Composer
is a controller used
to initialize a component (that might or might not implement
AfterCompose
).
Alternatives: in most cases, you don't implement Composer
directly.
Rather, you can extend from one of the following skeletons.
SelectorComposer
SelectorComposer
.GenericForwardComposer
AfterCompose
,
ComposerExt
,
FullComposer
,
Initiator
Method Summary | |
---|---|
void |
doAfterCompose(T comp)
Invokes after ZK loader creates this component, initializes it and composes all its children, if any. |
Method Detail |
---|
void doAfterCompose(T comp) throws java.lang.Exception
comp
- the component has been composed
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |