AU Responses"

From Documentation
m
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{ZKClient-sideReferencePageHeader}}
 
{{ZKClient-sideReferencePageHeader}}
  
An AU response is the command sent from the server to the client for synchronizing back the server's states and performing some functionality. In response to the [[ZK Client-side Reference/Communication/AU Requests|AU request]] sent by the client, the server could send one or multiple AU responses to the client. Each AU response consists of a command and a sequence of data. The command is a string, and the data could be any object (as long as [http://www.json.org/ JSON] can handle it).
+
An AU response is the command sent from the server to the client for synchronizing back the server's states and performing some functionality. In response to the [[ZK Client-side Reference/Communication/AU Requests|AU request]] sent by the client, the server could send one or multiple AU responses to the client. Each AU response consists of a command and a sequence of data. The command is a string, and the data could be any objects (as long as [http://www.json.org/ JSON] can handle it).
  
There are two groups of commands depending on whether the command is applied to a particular widget (<javadoc directory="jsdoc">zk.Widget</javadoc>), or to the whole browser.
+
There are two groups of commands depending on whether the command is applied to a particular widget (<javadoc directory="jsdoc">zk.Widget</javadoc>), or to the whole browser. For the sake of description, we call the first kind of commands as the widget commands, while the second kind the global commands.
  
* <javadoc directory="jsdoc">_global_.AuCmd0</javadoc>
+
{| border='1px' | width="100%"
*: A list of all commands that are applied to the whole browser.
+
! Class !! Object !! Description
* <javadoc directory="jsdoc">_global_.AuCmd1</javadoc>
+
|-
*: A list of all commands that are applied to a particular widget.
+
| <javadoc directory="jsdoc">zk.AuCmd0</javadoc>
 +
| <javadoc directory="jsdoc" method="cmd0">_global_.zAu</javadoc>
 +
| <javadoc directory="jsdoc">zk.AuCmd0</javadoc> is the class to handle all '''global''' commands (i.e., applied to the whole browser).
 +
Furthermore, all global commands are handled by an instance of <javadoc directory="jsdoc">zk.AuCmd0</javadoc> called <javadoc directory="jsdoc" method="cmd0">_global_.zAu</javadoc>.
 +
|-
 +
| <javadoc directory="jsdoc">zk.AuCmd1</javadoc>
 +
| <javadoc directory="jsdoc" method="cmd1">_global_.zAu</javadoc>
 +
| <javadoc directory="jsdoc">zk.AuCmd1</javadoc> is the class to handle all '''widget''' commands (i.e., applied to a particular widget).
 +
Furthermore, all widget commands are handled by an instance of <javadoc directory="jsdoc">zk.AuCmd1</javadoc> called <javadoc directory="jsdoc" method="cmd1">_global_.zAu</javadoc>.
 +
|}
 +
 
 +
=Add a New Command=
 +
If you'd like to add a new command, you could simply add a new property to to <javadoc directory="jsdoc" method="cmd0">_global_.zAu</javadoc> or <javadoc directory="jsdoc" method="cmd1">_global_.zAu</javadoc>, depending on your requirement. For example,
 +
 
 +
<source lang="javascript">
 +
zk.zAu.cmd0.bookmark = function (bk, replace) {
 +
    //...
 +
};
 +
</source>
  
 
=Version History=
 
=Version History=

Latest revision as of 02:57, 25 September 2019


An AU response is the command sent from the server to the client for synchronizing back the server's states and performing some functionality. In response to the AU request sent by the client, the server could send one or multiple AU responses to the client. Each AU response consists of a command and a sequence of data. The command is a string, and the data could be any objects (as long as JSON can handle it).

There are two groups of commands depending on whether the command is applied to a particular widget (Widget), or to the whole browser. For the sake of description, we call the first kind of commands as the widget commands, while the second kind the global commands.

Class Object Description
AuCmd0 zAu.cmd0 AuCmd0 is the class to handle all global commands (i.e., applied to the whole browser).

Furthermore, all global commands are handled by an instance of AuCmd0 called zAu.cmd0.

AuCmd1 zAu.cmd1 AuCmd1 is the class to handle all widget commands (i.e., applied to a particular widget).

Furthermore, all widget commands are handled by an instance of AuCmd1 called zAu.cmd1.

Add a New Command

If you'd like to add a new command, you could simply add a new property to to zAu.cmd0 or zAu.cmd1, depending on your requirement. For example,

zk.zAu.cmd0.bookmark = function (bk, replace) {
    //...
};

Version History

Last Update : 2019/09/25


Version Date Content
     



Last Update : 2019/09/25

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.