Attributes"
From Documentation
Line 1: | Line 1: | ||
{{ZUMLReferencePageHeader}} | {{ZUMLReferencePageHeader}} | ||
− | Each attribute, except special attributes like <code>if</code> and <code>forEach</code>, represents a value that shall be assigned to a property of a component after it is created. | + | Each attribute, except special attributes like <code>if</code> and <code>forEach</code>, represents a value that shall be assigned to a property of a component after it is created. For example, when an attribute, say, <code>foo</foo>, is specified, ZK Loader will assume there is a method called <code>setFoo</code> that accepts a single argument. If there are multiple methods with the same name, ZK Loader will use the one that matches the argument most (in term of the argument's class). |
+ | |||
+ | For example, suppose <code>${foo}</code> is evaluated to an integer in the following example, ZK Loader will invoke <javadoc method="setMode(int)">org.zkoss.zul.Window</javadoc>, rather than <javadoc method="setMode(java.lang.String)">org.zkoss.zul.Window</javadoc>. | ||
+ | |||
+ | <source lang="xml"> | ||
+ | <window mode="${foo}"> | ||
+ | ... | ||
+ | </source> | ||
In the following sections, we will discuss the special attributes one-by-one. | In the following sections, we will discuss the special attributes one-by-one. | ||
{{ZUMLReferenceHeadingToc}} | {{ZUMLReferenceHeadingToc}} | ||
− | |||
{{ZUMLReferencePageFooter}} | {{ZUMLReferencePageFooter}} |
Revision as of 06:43, 15 November 2010
Each attribute, except special attributes like if
and forEach
, represents a value that shall be assigned to a property of a component after it is created. For example, when an attribute, say, foo</foo>, is specified, ZK Loader will assume there is a method called
setFoo
that accepts a single argument. If there are multiple methods with the same name, ZK Loader will use the one that matches the argument most (in term of the argument's class).
For example, suppose
${foo}
is evaluated to an integer in the following example, ZK Loader will invoke Window.setMode(int), rather than Window.setMode(String).
<window mode="${foo}">
...
In the following sections, we will discuss the special attributes one-by-one.