|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zk.au.AuResponse
org.zkoss.zk.au.out.AuInvoke
public class AuInvoke
A response to ask the client to invoke a function.
Unlike 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.
Field Summary |
---|
Fields inherited from class org.zkoss.zk.au.AuResponse |
---|
_cmd, _data, SC_ACTIVATION_TIMEOUT, SC_OUT_OF_SEQUENCE |
Constructor Summary | |
---|---|
AuInvoke(Component comp,
java.lang.String function)
Construct AuInvoke to call the peer widget's member function with no argument. |
|
AuInvoke(Component comp,
java.lang.String function,
boolean arg)
Construct AuInvoke to call the peer widget's member function with one boolean argument. |
|
AuInvoke(Component comp,
java.lang.String function,
double arg)
Construct AuInvoke to call the peer widget's member function with one double argument. |
|
AuInvoke(Component comp,
java.lang.String function,
int arg)
Construct AuInvoke to call the peer widget's member function with one int argument. |
|
AuInvoke(Component comp,
java.lang.String function,
java.lang.Object... args)
Construct AuInvoke to call the peer widget's member function with an array of the given arguments. |
|
AuInvoke(Component comp,
java.lang.String function,
java.lang.Object arg)
Construct AuInvoke to call the peer widget's member function with one argument. |
|
AuInvoke(Component comp,
java.lang.String function,
java.lang.Object arg1,
java.lang.Object arg2)
Construct AuInvoke to call the peer widget's member function with two arguments. |
|
AuInvoke(Component comp,
java.lang.String function,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Construct AuInvoke to call the peer widget's member function with three arguments. |
|
AuInvoke(Component comp,
java.lang.String function,
java.lang.String... args)
Construct AuInvoke to call a client function with variable number of arguments. |
|
AuInvoke(java.lang.String function,
java.lang.Object... args)
Construct AuInvoke to call a global function at the client with the given arguments. |
Method Summary |
---|
Methods inherited from class org.zkoss.zk.au.AuResponse |
---|
equals, getCommand, getDepends, getEncodedData, getOverrideKey, getRawData, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AuInvoke(Component comp, java.lang.String function)
comp
- the component that the widget is associated with.
It cannot be null.function
- the function namepublic AuInvoke(Component comp, java.lang.String function, java.lang.Object arg)
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 by
AuInvoke(Component, String, Object[])
, and then considered
as an array of arguments (rather than an argument with an array-type value.
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).public AuInvoke(Component comp, java.lang.String function, boolean arg)
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.public AuInvoke(Component comp, java.lang.String function, int arg)
comp
- the component that the widget is associated with.
It cannot be null.function
- the function namearg
- the additional argument.public AuInvoke(Component comp, java.lang.String function, double arg)
comp
- the component that the widget is associated with.
It cannot be null.function
- the function namearg
- the additional argument.public AuInvoke(Component comp, java.lang.String function, java.lang.Object arg1, java.lang.Object arg2)
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.public AuInvoke(Component comp, java.lang.String function, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
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.public AuInvoke(Component comp, java.lang.String function, java.lang.Object... args)
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).public AuInvoke(Component comp, java.lang.String function, java.lang.String... args)
zkType.function(comp, args[0], args[1], args[2]...)
comp
- the component that this script depends on.
It cannot be null.function
- the function namepublic AuInvoke(java.lang.String function, java.lang.Object... args)
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).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |