custom-attributes"
Line 4: | Line 4: | ||
'''Syntax:''' | '''Syntax:''' | ||
− | |||
<custom-attributes | <custom-attributes | ||
− | [scope="component|space|page|desktop|session|application"] | + | [scope="'''component'''|space|page|desktop|session|application"] |
− | attr1="value1" [attr2="value2"...]/ | + | ''attr1''="''value1''" [''attr2''="''value2''"...]/> |
− | |||
It defines a set of custom attributes of the specified scope. You could specify as many as attributes you want. These attributes can be retrieved by the <tt>getAttribute</tt> method of the <tt>Component</tt> interface with the specified scope. | It defines a set of custom attributes of the specified scope. You could specify as many as attributes you want. These attributes can be retrieved by the <tt>getAttribute</tt> method of the <tt>Component</tt> interface with the specified scope. | ||
Line 18: | Line 16: | ||
== scope == | == scope == | ||
− | + | [optional][Default: component] | |
− | [optional][Default: component] | ||
− | |||
Specifies the scope to which the custom attributes are associated. If not specified, the component enclosing this element is the default scope to use. | Specifies the scope to which the custom attributes are associated. If not specified, the component enclosing this element is the default scope to use. | ||
Line 26: | Line 22: | ||
== composite == | == composite == | ||
− | + | [Optional][Default: none] | |
− | [Optional][Default: none] | ||
− | |||
Specifies the format of the value. It could be <tt>none</tt>, <tt>list</tt> or <tt>map</tt>. | Specifies the format of the value. It could be <tt>none</tt>, <tt>list</tt> or <tt>map</tt>. | ||
Line 52: | Line 46: | ||
== if == | == if == | ||
− | + | [Optional][Default: true] | |
− | [Optional][Default: true] | ||
− | |||
Specifies the condition to evaluate this element. This element is ignored if the value specified to this attribute is evaluated to false. | Specifies the condition to evaluate this element. This element is ignored if the value specified to this attribute is evaluated to false. | ||
Line 60: | Line 52: | ||
== unless == | == unless == | ||
− | + | [Optional][Default: false] | |
− | [Optional][Default: false] | ||
− | |||
Specifies the condition ''not'' to evaluate this element. This element is ignored if the value specified to this attribute is evaluated to true. | Specifies the condition ''not'' to evaluate this element. This element is ignored if the value specified to this attribute is evaluated to true. |
Revision as of 10:42, 18 November 2010
Syntax:
<custom-attributes [scope="component|space|page|desktop|session|application"] attr1="value1" [attr2="value2"...]/>
It defines a set of custom attributes of the specified scope. You could specify as many as attributes you want. These attributes can be retrieved by the getAttribute method of the Component interface with the specified scope.
<custom-attributes cd="${param.cd}" a.b="ab"/>
scope
[optional][Default: component]
Specifies the scope to which the custom attributes are associated. If not specified, the component enclosing this element is the default scope to use.
composite
[Optional][Default: none]
Specifies the format of the value. It could be none, list or map.
By default, the value is assigned to the attribute directly after evaluating EL expressions, if any. For example, "apple, ${more}" is evaluated to "apple, orange", if more is "orange", and assigned to the attribute.
If you want to specify a list of values, you can specify the composite attribute with list as follows.
<custom-attributes simple="apple, ${more}" composite="list"/>
Then, it is converted to a list with two elements. The first element is "apple" and the second "orange".
If you want to specify a map of values, you can specify the composite attribute with map as follows.
<custom-attributes simple="juice=apple, flavor=${more}" composite="map"/>
Then, it is converted to a map with two entries. The first entry is ("juice", "apple") and the second ("flavor", "orange").
if
[Optional][Default: true]
Specifies the condition to evaluate this element. This element is ignored if the value specified to this attribute is evaluated to false.
unless
[Optional][Default: false]
Specifies the condition not to evaluate this element. This element is ignored if the value specified to this attribute is evaluated to true.
Version History
Version | Date | Content |
---|---|---|