Component Properties"

From Documentation
Line 15: Line 15:
  
 
==Application-wid Initialization==
 
==Application-wid Initialization==
 +
 +
If you prefer to have the same initial value for all ZUML documents, you could specify it in [[ZK Developer's Reference/Language Definition|a language addon]]. For example, we could prepare a file called <tt>WEB-INF/lang-addon.xml</tt> with the following content:
 +
 +
<source lang="xml">
 +
<language-addon>
 +
<component>
 +
<component-name>window</component-name>
 +
<extends>window</extends>
 +
<property>
 +
<property-name>border</property-name>
 +
<property-value>normal</property-value>
 +
</property>
 +
</component>
 +
</language-addon>
 +
</source>
 +
 +
Then, we could specify this file by adding the following content to <tt>WEB-INF/zk.xml</tt>:
 +
 +
<source lang="xml">
 +
<language-config>
 +
<addon-uri>/WEB-INF/lang-addon.xml</addon-uri>
 +
</language-config>
 +
</source>
 +
 +
For more information, please refer to [[ZK Configuration Reference/zk.xml/The language-config Element|ZK Configuration Reference]].
 +
 
=Molds=
 
=Molds=
 
=Attributes=
 
=Attributes=

Revision as of 03:12, 30 November 2010


Component Properties


With component definitions, we could specify the initial values for the properties, attributes and annotations of a component.

Properties

Depending on the requirement, you could change the initial value of a property for a particular ZUML document, or for the whole application.

Page-wide Initialization

Suppose we want to assign normal to the border property (Window.setBorder(String)) of all windows in a ZUML document, then we could use the component directive as follows.

<?component name="window" extends="window" border="normal"?>
<window title="Border"/>

Application-wid Initialization

If you prefer to have the same initial value for all ZUML documents, you could specify it in a language addon. For example, we could prepare a file called WEB-INF/lang-addon.xml with the following content:

<language-addon>
	<component>
		<component-name>window</component-name>
		<extends>window</extends>
		<property>
			<property-name>border</property-name>
			<property-value>normal</property-value>
		</property>
	</component>
</language-addon>

Then, we could specify this file by adding the following content to WEB-INF/zk.xml:

	<language-config>
		<addon-uri>/WEB-INF/lang-addon.xml</addon-uri>
	</language-config>

For more information, please refer to ZK Configuration Reference.

Molds

Attributes

Depending on the requirement, you could change the initial value of an attribute for a particular ZUML document, or for the whole application.

Page-wide Initialization

Application-wid Initialization

Version History

Last Update : 2010/11/30


Version Date Content
     



Last Update : 2010/11/30

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.