function"
From Documentation
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{ZKClient-sideReferencePageHeader}} |
'''syntax''' | '''syntax''' | ||
<function class="''foo.MyClass''" singature="''java.lang.String'' ''funcName''(''Class0'', ''Class1'')"/> | <function class="''foo.MyClass''" singature="''java.lang.String'' ''funcName''(''Class0'', ''Class1'')"/> | ||
− | Specifies a static method (aka., a function) that | + | Specifies a static method (aka., a function) that should be called when a WPD file is interpreted. The returned string will be generated directly to the output. In other words, it must be a valid JavaScript code snippet. |
Example, | Example, | ||
Line 24: | Line 24: | ||
[Required] | [Required] | ||
− | The signature of the static method. The return type has to be a string and the return value | + | The signature of the static method. The return type has to be a string and the return value should be a valid JavaScript code snippet. |
The method might have arbitrary numbers of arguments. WPD will check the type of each argument and assign a proper value if possible. The following is the type WPD recognized: | The method might have arbitrary numbers of arguments. WPD will check the type of each argument and assign a proper value if possible. The following is the type WPD recognized: | ||
Line 54: | Line 54: | ||
|} | |} | ||
− | {{ | + | {{ZKClient-sideReferencePageFooter}} |
Latest revision as of 09:50, 23 August 2011
syntax
<function class="foo.MyClass" singature="java.lang.String funcName(Class0, Class1)"/>
Specifies a static method (aka., a function) that should be called when a WPD file is interpreted. The returned string will be generated directly to the output. In other words, it must be a valid JavaScript code snippet.
Example,
<package name="zul.lang" cacheable="false">
<script src="msgzul*.js"/>
<function class="org.zkoss.zul.impl.Utils"
signature="java.lang.String outLocaleJavaScript()"/>
</package>
class
[Required]
The name of the class where the static method is declared.
signature
[Required]
The signature of the static method. The return type has to be a string and the return value should be a valid JavaScript code snippet.
The method might have arbitrary numbers of arguments. WPD will check the type of each argument and assign a proper value if possible. The following is the type WPD recognized:
Argument Type | Value |
---|---|
javax.servlet.ServletRequest and derives | The current request. |
javax.servlet.ServletResponse and derives | The current response. |
javax.servlet.ServletContext | The current servlet context. |
Others | null |
Version History
Version | Date | Content |
---|---|---|