Custom Taglib"
From Documentation
Line 1: | Line 1: | ||
{{ZUMLReferencePageHeader}} | {{ZUMLReferencePageHeader}} | ||
=The Syntax of Taglib Document= | =The Syntax of Taglib Document= | ||
+ | |||
+ | The syntax of a Taglib document is the same as JSP's taglib (aka., TLD), so you could use JSP's TLD files directly. However, ZK only recognize the function elements. All others are ignored. | ||
+ | |||
+ | Here is an example: | ||
+ | |||
+ | <source lang="xml"> | ||
+ | <taglib> | ||
+ | <function> | ||
+ | <name>browser</name> | ||
+ | <function-class>org.zkoss.web.fn.ServletFns</function-class> | ||
+ | <function-signature> | ||
+ | boolean isBrowser(java.lang.String) | ||
+ | </function-signature> | ||
+ | <description> | ||
+ | Whether the current request is coming from the browser of the specified | ||
+ | type. | ||
+ | </description> | ||
+ | </function> | ||
+ | <function> | ||
+ | <name>l</name> | ||
+ | <function-class>org.zkoss.xel.fn.CommonFns</function-class> | ||
+ | <function-signature>java.lang.String getLabel(java.lang.String)</function-signature> | ||
+ | <description> | ||
+ | Returns the label of the specified key. | ||
+ | </description> | ||
+ | </function> | ||
+ | </taglib> | ||
+ | </source> | ||
+ | |||
+ | where | ||
+ | |||
+ | *The root element must be called <code>taglib</code> | ||
+ | *Each function declaration must be called <code>function</code>. It requires three sub-elements: <code>name</code>, <code>function-class</code> and <code>function-signature</code>. The <code>description</code> element is optional (for documentation only). | ||
+ | |||
=Configure Tag Documents as Built-in= | =Configure Tag Documents as Built-in= | ||
=Version History= | =Version History= |
Revision as of 10:06, 15 November 2010
The Syntax of Taglib Document
The syntax of a Taglib document is the same as JSP's taglib (aka., TLD), so you could use JSP's TLD files directly. However, ZK only recognize the function elements. All others are ignored.
Here is an example:
<taglib>
<function>
<name>browser</name>
<function-class>org.zkoss.web.fn.ServletFns</function-class>
<function-signature>
boolean isBrowser(java.lang.String)
</function-signature>
<description>
Whether the current request is coming from the browser of the specified
type.
</description>
</function>
<function>
<name>l</name>
<function-class>org.zkoss.xel.fn.CommonFns</function-class>
<function-signature>java.lang.String getLabel(java.lang.String)</function-signature>
<description>
Returns the label of the specified key.
</description>
</function>
</taglib>
where
- The root element must be called
taglib
- Each function declaration must be called
function
. It requires three sub-elements:name
,function-class
andfunction-signature
. Thedescription
element is optional (for documentation only).
Configure Tag Documents as Built-in
Version History
Last Update : 2010/11/15
Version | Date | Content |
---|---|---|