HtmlMacroComponent"
Jumperchen (talk | contribs) |
Jumperchen (talk | contribs) |
||
Line 11: | Line 11: | ||
The base class for macro components. | The base class for macro components. | ||
− | If you want to apply the auto-wiring, you can invoke <javadoc method="wireVariables(org.zkoss.zk.ui.Component, java.lang.Object)">org.zkoss.zk.ui.Components</javadoc> in <javadoc method="afterCompose()">org.zkoss.zk.ui.HtmlMacroComponent</javadoc> as follows. | + | Since ZK 5.0.4, by default invoking <javadoc method="afterCompose()">org.zkoss.zk.ui.HtmlMacroComponent</javadoc> supports auto forward events and wire accessible variables to this component. |
+ | |||
+ | You can turn on/off auto wire mechanism by specifying the Library Property "org.zkoss.zk.ui.macro.autowire.disabled" to "true" in WEB-INF/zk.xml. If you did not specify the Library Property, default is false. | ||
+ | <source lang="xml"><library-property> | ||
+ | <name>org.zkoss.zk.ui.macro.autowire.disabled</name> | ||
+ | <value>true</value> | ||
+ | </library-property></source> | ||
+ | or turn on/off auto forward events by specifying the Library Property "org.zkoss.zk.ui.macro.autoforward.disabled" to "true" in WEB-INF/zk.xml. If you did not specify the Library Property, default is false. | ||
+ | <source lang="xml"><library-property> | ||
+ | <name>org.zkoss.zk.ui.macro.autoforward.disabled</name> | ||
+ | <value>true</value> | ||
+ | </library-property></source> | ||
+ | |||
+ | In the early version, if you want to apply the auto-wiring, you can invoke <javadoc method="wireVariables(org.zkoss.zk.ui.Component, java.lang.Object)">org.zkoss.zk.ui.Components</javadoc> in <javadoc method="afterCompose()">org.zkoss.zk.ui.HtmlMacroComponent</javadoc> as follows. | ||
<source lang="java"> | <source lang="java"> |
Revision as of 03:08, 20 August 2010
Html Macro Component
- Demonstration: N/A
- Java API: AbstractComponent
- JavaScript API: N/A
Employment/Purpose
The base class for macro components.
Since ZK 5.0.4, by default invoking HtmlMacroComponent.afterCompose() supports auto forward events and wire accessible variables to this component.
You can turn on/off auto wire mechanism by specifying the Library Property "org.zkoss.zk.ui.macro.autowire.disabled" to "true" in WEB-INF/zk.xml. If you did not specify the Library Property, default is false.
<library-property>
<name>org.zkoss.zk.ui.macro.autowire.disabled</name>
<value>true</value>
</library-property>
or turn on/off auto forward events by specifying the Library Property "org.zkoss.zk.ui.macro.autoforward.disabled" to "true" in WEB-INF/zk.xml. If you did not specify the Library Property, default is false.
<library-property>
<name>org.zkoss.zk.ui.macro.autoforward.disabled</name>
<value>true</value>
</library-property>
In the early version, if you want to apply the auto-wiring, you can invoke Components.wireVariables(Component, Object) in HtmlMacroComponent.afterCompose() as follows.
public void afterCompose() {
super.afterCompose(); //create components
Components.wireVariables(this, this);
Components.addForward(this, this);
}
Example
N/A
Supported Events
None | None |
See also events inherited from HtmlBasedComponent's Supported Events.
Supported Children
*ALL
Use cases
Version | Description | Example Location |
---|---|---|
Version History
Version | Date | Content |
---|---|---|
5.0.3 | June 2010 | The corresponding DOM element is customizable. It is default to SPAN (the same as prior version) but you can change it to any tag by use of HtmlMacroComponent.setEnclosingTag(String). |
5.0.4 | August 2010 | By default, invoking HtmlMacroComponent.afterCompose() supports auto forward events and wire accessible variables to this component. |