Useful Java Utilities"
m |
m |
||
Line 68: | Line 68: | ||
===showNotification=== | ===showNotification=== | ||
+ | [since 6.0.1] | ||
[http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/Clients.html#showNotification(java.lang.String) Clients.showNotification()] | [http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/Clients.html#showNotification(java.lang.String) Clients.showNotification()] | ||
Line 73: | Line 74: | ||
<source lang="java"> | <source lang="java"> | ||
− | Clients.showNotification(msg); | + | Clients.showNotification(msg); // display a global notification box |
+ | Clients.showNotification(msg, window); // display a notification box pointing to window | ||
+ | </source> | ||
+ | |||
+ | <source lang="java"> | ||
+ | Clients.showNotification(msg, type, window, position, duration); | ||
</source> | </source> | ||
// TODO | // TODO | ||
+ | |||
+ | // TODO: type | ||
+ | // TODO: position | ||
=Version History= | =Version History= |
Revision as of 05:01, 29 March 2012
In this section we introduce some of the most commonly used Java utility classes.
Executions
getCurrent
Retrieves the current execution (request/response).
createComponents
With this method, you can create components defined in another zul file and attach them to the current page.
sendRedirect
Redirects to another URL. If the parameter is left null, it will redirect to the current page.
Sessions
getCurrent
Retrieves the current session.
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
[since 6.0.1]
Show a notification box, which is dismissed upon left click (like Popup). You can either display a global notification (bigger) or one specific to another component (smaller with arrow pointing to it). You can also specify its position, style, and duration (for auto-dismiss).
Clients.showNotification(msg); // display a global notification box
Clients.showNotification(msg, window); // display a notification box pointing to window
Clients.showNotification(msg, type, window, position, duration);
// TODO
// TODO: type // TODO: position
Version History
Version | Date | Content |
---|---|---|