Class HtmlMacroComponent

All Implemented Interfaces:
Serializable, Cloneable, Component, AfterCompose, DynamicPropertied, Macro, Scope, IdSpace, ComponentCtrl

public class HtmlMacroComponent extends HtmlBasedComponent implements Macro
The implementation of a macro component for HTML-based clients.

Generally, a macro component is created automatically by ZK loader. If a developer wants to create it manually, it has to instantiate from the correct class, and then invoke afterCompose().

To do additional application-specific tasks, you could override compose(). Both afterCompose() and recreate() depends on compose().

By default, compose() will wire members by use of Selectors. In other words, it will wire annotated members the same way as SelectorComposer does.

If you prefer to wire the members based on the name convention as GenericForwardComposer does (i.e., backward compatible with ZK 5), you could specify a library property called org.zkoss.zk.ui.macro.autowire.convention to true in WEB-INF/zk.xml as follows.


        <library-property>
                <name>org.zkoss.zk.ui.macro.autowire.convention</name>
                <value>true</value>
        </library-property>
 

If you prefer not to wire at all (neither by-selector nor by-convention), you could specify a library property called org.zkoss.zk.ui.macro.autowire.disabled to true in WEB-INF/zk.xml as follows..


        <library-property>
                <name>org.zkoss.zk.ui.macro.autowire.disabled</name>
                <value>true</value>
        </library-property>
 
Author:
tomyeh
See Also: