Useful Java Utilities"
From Documentation
Line 18: | Line 18: | ||
===evalJavaScript=== | ===evalJavaScript=== | ||
[http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/Clients.html#evalJavaScript%28java.lang.String%29 Clients.evalJavaScript()] | [http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/Clients.html#evalJavaScript%28java.lang.String%29 Clients.evalJavaScript()] | ||
+ | |||
+ | This method sends an AU Response to execute the given JavaScript on client side, which is the standard way of calling JavaScript from server side in ZK. For example, | ||
+ | |||
+ | <source lang="java"> | ||
+ | Clients.evalJavaScript("zk.log('Hi.');"); | ||
+ | </source> | ||
===scrollIntoView=== | ===scrollIntoView=== | ||
[http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/Clients.html#scrollIntoView(org.zkoss.zk.ui.Component) Clients.scrollIntoView()] | [http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/Clients.html#scrollIntoView(org.zkoss.zk.ui.Component) Clients.scrollIntoView()] | ||
+ | |||
+ | Scrolls the parent of the given component, so the given one become visible in the view. | ||
===showBusy/clearBusy=== | ===showBusy/clearBusy=== | ||
Line 26: | Line 34: | ||
[http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/Clients.html#clearBusy() Clients.clearBusy()] | [http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/Clients.html#clearBusy() Clients.clearBusy()] | ||
+ | |||
+ | Display/dismiss a busy icon, so user knows server is working or has finished working on something. For example, | ||
+ | |||
+ | <source lang="java"> | ||
+ | Clients.showBusy(window, "Waiting for server..."); | ||
+ | </source> | ||
+ | |||
+ | [[Image:ZKDevRef_UIPattern_UsefulJavaUtil_Clients_showBusy.png]] | ||
===showNotification=== | ===showNotification=== |
Revision as of 04:26, 29 March 2012
In this section we introduce some of the most commonly used Java utility classes.
Executions
Sessions
Clients
This class offers a collection of methods which manipulate client side via AU Response.
evalJavaScript
This method sends an AU Response to execute the given JavaScript on client side, which is the standard way of calling JavaScript from server side in ZK. For example,
Clients.evalJavaScript("zk.log('Hi.');");
scrollIntoView
Scrolls the parent of the given component, so the given one become visible in the view.
showBusy/clearBusy
Display/dismiss a busy icon, so user knows server is working or has finished working on something. For example,
Clients.showBusy(window, "Waiting for server...");
showNotification
Version History
Version | Date | Content |
---|---|---|