Class AuInvoke
AuScript, it invokes the given function (rather than
evaluates a JavaScript snippet).
There are basically two approaches.
First, AuInvoke(Component, String, Object...) is used to invoke
the method of the peer widget of the given component.
Second, AuInvoke(String, Object...) is used to invoke
a global function (at the client).
data[0]: the component
data[1]: the client function name (i.e., JavaScript function)
data[2]: the second argument
data[3]: the third argument...
Note: the first argument is always the component itself.
- Since:
- 3.0.0
- Author:
- tomyeh
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.au.AuResponse
AuResponse.JSONComponent, AuResponse.JSONDate -
Field Summary
Fields inherited from class org.zkoss.zk.au.AuResponse
_cmd, _data, SC_ACTIVATION_TIMEOUT, SC_OUT_OF_SEQUENCE -
Constructor Summary
ConstructorsConstructorDescriptionConstruct AuInvoke to call a global function at the client with the given arguments.Construct AuInvoke to call the peer widget's member function with no argument.Construct AuInvoke to call the peer widget's member function with one boolean argument.Construct AuInvoke to call the peer widget's member function with one double argument.Construct AuInvoke to call the peer widget's member function with one int argument.Construct AuInvoke to call the peer widget's member function with one argument.Construct AuInvoke to call the peer widget's member function with an array of the given arguments.Construct AuInvoke to call the peer widget's member function with two arguments.Construct AuInvoke to call the peer widget's member function with three arguments.Construct AuInvoke to call a client function with variable number of arguments. -
Method Summary
Methods inherited from class org.zkoss.zk.au.AuResponse
equals, getCommand, getDepends, getEncodedData, getOverrideKey, getRawData, hashCode, toString
-
Constructor Details
-
AuInvoke
Construct AuInvoke to call the peer widget's member function with no argument.- Parameters:
comp- the component that the widget is associated with. It cannot be null.function- the function name
-
AuInvoke
Construct AuInvoke to call the peer widget's member function with one argument.Notice that if you want to pass an array-type argument, you have to cast it to Object as follows:
new AuInvoke(comp, "setOverride", (Object)new Object[] {"a", "b"}).
Otherwise, the third argument will be handled byAuInvoke(Component, String, Object[]), and then considered as an array of arguments (rather than an argument with an array-type value.- Parameters:
comp- the component that the widget is associated with. It cannot be null.function- the function namearg- the additional argument. It could be null, String, Date,DeferredValue, and any kind of objects that the client accepts (marshaled by JSON).- Since:
- 5.0.0
-
AuInvoke
Construct AuInvoke to call the peer widget's member function with one boolean argument.- Parameters:
comp- the component that the widget is associated with. It cannot be null.function- the function namearg- the additional argument. Different devices might support more types.- Since:
- 5.0.0
-
AuInvoke
Construct AuInvoke to call the peer widget's member function with one int argument.- Parameters:
comp- the component that the widget is associated with. It cannot be null.function- the function namearg- the additional argument.- Since:
- 5.0.0
-
AuInvoke
Construct AuInvoke to call the peer widget's member function with one double argument.- Parameters:
comp- the component that the widget is associated with. It cannot be null.function- the function namearg- the additional argument.- Since:
- 5.0.0
-
AuInvoke
Construct AuInvoke to call the peer widget's member function with two arguments.- Parameters:
comp- the component that the widget is associated with. It cannot be null.function- the function namearg1- the additional argument. It could be null, String, Date,DeferredValue, and any kind of objects that the client accepts (marshaled by JSON).arg2- the 2nd additional argument.- Since:
- 5.0.0
-
AuInvoke
Construct AuInvoke to call the peer widget's member function with three arguments.- Parameters:
comp- the component that the widget is associated with. It cannot be null.function- the function namearg1- the additional argument. It could be null, String, Date,DeferredValue, and any kind of objects that the client accepts (marshaled by JSON).arg2- the 2nd additional argument.arg3- the 3rd additional argument.- Since:
- 5.0.0
-
AuInvoke
Construct AuInvoke to call the peer widget's member function with an array of the given arguments.- Parameters:
comp- the component that the widget is associated with. It cannot be null.function- the function nameargs- the additional arguments. It could be null, String, Date,DeferredValue,Component,JavaScriptValue, and any kind of objects that the client accepts (notice that they are marshaled by JSON).- Since:
- 3.6.1
-
AuInvoke
Construct AuInvoke to call a client function with variable number of arguments. Notice that the component itself will be inserted in front of the specified argument array. In other words, the first argument is the component itself, the second is the first item in the argument array, and so on.
zkType.function(comp, args[0], args[1], args[2]...)- Parameters:
comp- the component that this script depends on. It cannot be null.function- the function name- Since:
- 3.6.0
-
AuInvoke
Construct AuInvoke to call a global function at the client with the given arguments.- Parameters:
function- the function nameargs- the additional arguments. It could be null, String, Date,DeferredValue,Component,JavaScriptValue, and any kind of objects that the client accepts (notice that they are marshaled by JSON).- Since:
- 6.0.0
-