| 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
- Invoke
ComposerExt.doBeforeCompose , if the composer
also implements
ComposerExt .
- Create the component (by use of
org.zkoss.zk.ui.sys.UiFactory.newComponent , which creates
and initializes the component accordingly).
- Invokes
ComposerExt.doBeforeComposeChildren , if
ComposerExt is also implemented.
- Composes all children, if any, of this component defined in
the ZUML page.
- Invokes
Composer.doAfterCompose after all children are, if any,
composed.
- Posts the onCreate event if necessary.
To intercept the lifecycle of the creation of a page,
implement
Initiator and specify the class with the init directive.
Note:
org.zkoss.zk.ui.ext.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
org.zkoss.zk.ui.ext.AfterCompose ).
author: tomyeh since: 3.0.0 See Also: org.zkoss.zk.ui.ext.AfterCompose See Also: ComposerExt See Also: Initiator |