zk
Class AuCmd0

java.lang.Object
  extended by zk.AuCmd0

public class AuCmd0
extends java.lang.Object

The AU command handler for processes commands not related to widgets, sent from the server.

See Also:
zAu.cmd0

Method Summary
 void alert(String msg)
          Shows an alert to indicate some error occurs.
 void bookmark(String bk, boolean replace)
          Sets a bookmark
 void cfmClose(String msg)
          Sets the message used to confirm the user when he is closing the browser window.
 void clearBusy()
          Removes the busy message covering the whole browser.
 void clearBusy(String uuid)
          Removes the busy message covering the specified widget.
 void clearWrongValue(String... any)
          Closes the all error messages related to the specified widgets.
 void clientInfo(String dtid)
          Asks the client information.
 void download(String url)
          Asks the client to download the resource at the specified URL.
 void echo(String dtid)
          Asks the client to echo back an AU request, such that the server can return other commands.
 void echoGx(String evtnm, String data, String... any)
          Ask the client to echo back globally.
 void log(String msg)
          Logs the message.
 void moveBy(int x, int y)
          Moves the browser window.
 void moveTo(int x, int y)
          Moves the browser window to the specified location
 void obsolete(String dtid, String msg)
          Shows an error to indicate the desktop is timeout.
 void print()
          Prints the content of the browser window.
 void redirect(String url, String target)
          Redirects to the specified URL.
 void resizeBy(int x, int y)
          Resizes the browser window.
 void resizeTo(int x, int y)
          Resizes the browser window to the specified size.
 void script(String script)
          Executes the JavaScript.
 void scrollBy(int x, int y)
          Scrolls the content of the browser window.
 void scrollIntoView(String id)
          Scrolls the widget or an DOM element into the view
 void scrollTo(int x, int y)
          Scrolls the contents of the browser window to the specified location.
 void showBusy(String msg)
          Shows the busy message covering the whole browser window.
 void showBusy(String uuid, String msg)
          Shows the busy message covering the specified widget.
 void showNotification(String msg, String pid, String ref, String pos, int dur)
          Shows a notifaction popup.
 void submit(String id)
          Submit a form.
 void title(String title)
          Changes the brower window's titile.
 void wrongValue(Object... the)
          Shows the error messages for the specified widgets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bookmark

public void bookmark(String bk,
                     boolean replace)
Sets a bookmark

Parameters:
bk - the bookmark
replace - if true, it will replace the bookmark without creating a new one history.

obsolete

public void obsolete(String dtid,
                     String msg)
Shows an error to indicate the desktop is timeout.

Parameters:
dtid - the desktop UUID
msg - the error message

alert

public void alert(String msg)
Shows an alert to indicate some error occurs. For widget's error message, use wrongValue(zk.Object...) instead.

Parameters:
msg - the error message

redirect

public void redirect(String url,
                     String target)
Redirects to the specified URL.

Parameters:
url - the URL to redirect to
target - [optional] the window name to show the content of the URL. If omitted, it will replace the current content.

title

public void title(String title)
Changes the brower window's titile.

Parameters:
title - the new title

script

public void script(String script)
Executes the JavaScript.

Parameters:
script - the JavaScript code snippet to execute

echo

public void echo(String dtid)
Asks the client to echo back an AU request, such that the server can return other commands. It is used to give the end user a quick response before doing a long operation.

Parameters:
dtid - the desktop ID (Desktop).
See Also:
AuCmd1.echo2(zk.Widget, _global_.String, zk.Object), echoGx(_global_.String, _global_.String, _global_.String...)

clientInfo

public void clientInfo(String dtid)
Asks the client information. The client will reply the information in the onClientInfo response.

Parameters:
dtid - the desktop ID (Desktop).

download

public void download(String url)
Asks the client to download the resource at the specified URL.

Parameters:
url - the URL to download from

print

public void print()
Prints the content of the browser window.


scrollBy

public void scrollBy(int x,
                     int y)
Scrolls the content of the browser window.

Parameters:
x - the offset (difference) in the X coordinate (horizontally) (pixels)
y - the offset in the Y coordinate (vertically) (pixels)

scrollTo

public void scrollTo(int x,
                     int y)
Scrolls the contents of the browser window to the specified location.

Parameters:
x - the X coordinate to scroll to (pixels)
y - the Y coordinate to scroll to (pixels)

resizeBy

public void resizeBy(int x,
                     int y)
Resizes the browser window.

Parameters:
x - the number of pixels to increase/decrease (pixels)
y - the number of pixels to increase/decrease (pixels)

resizeTo

public void resizeTo(int x,
                     int y)
Resizes the browser window to the specified size.

Parameters:
x - the required width (pixels)
y - the required height (pixels)

moveBy

public void moveBy(int x,
                   int y)
Moves the browser window.

Parameters:
x - the number of pixels to move in the X coordinate
y - the number of pixels to move in the Y coordinate

moveTo

public void moveTo(int x,
                   int y)
Moves the browser window to the specified location

Parameters:
x - the left (pixels)
y - the top (pixels)

cfmClose

public void cfmClose(String msg)
Sets the message used to confirm the user when he is closing the browser window.

Parameters:
msg - the message to show in the confirm dialog

showNotification

public void showNotification(String msg,
                             String pid,
                             String ref,
                             String pos,
                             int dur)
Shows a notifaction popup.

Parameters:
msg - message to show
pid - uuid of the page to which it belongs
ref - uuid of a reference component
pos - the position of notification
dur - the duration of notification

showBusy

public void showBusy(String msg)
Shows the busy message covering the whole browser window.

Parameters:
msg - the message.

showBusy

public void showBusy(String uuid,
                     String msg)
Shows the busy message covering the specified widget.

Parameters:
uuid - the component's UUID
msg - the message.

clearBusy

public void clearBusy()
Removes the busy message covering the whole browser.


clearBusy

public void clearBusy(String uuid)
Removes the busy message covering the specified widget.

Parameters:
uuid - the component's UUID

clearWrongValue

public void clearWrongValue(String... any)
Closes the all error messages related to the specified widgets. It assumes Widget has a method called clearErrorMessage (such as InputWidget.clearErrorMessage(boolean, boolean)). If no such method, nothing happens.

Parameters:
any - number of UUID of widgets.
See Also:
wrongValue(zk.Object...)

wrongValue

public void wrongValue(Object... the)
Shows the error messages for the specified widgets. It assumes Widget has a method called setErrorMessage (such as InputWidget.setErrorMessage(_global_.String)). If no such method, jq is used instead.

Parameters:
the - widgets and messages. The first argument is the widget's UUID, and the second is the error message. The third is UUID, then the fourth the error message, and so on.
See Also:
clearWrongValue(_global_.String...)

submit

public void submit(String id)
Submit a form. This method looks for the widget first. If found and the widget has a method called submit, then the widget's submit method is called. Otherwise, it looks for the DOM element and invokes the submit method (i.e., assume it is the FROM element).

Parameters:
id - the UUID of the widget, or the ID of the FORM element.

scrollIntoView

public void scrollIntoView(String id)
Scrolls the widget or an DOM element into the view

Parameters:
id - the UUID of the widget, or the ID of the DOM element.

log

public void log(String msg)
Logs the message.

Parameters:
msg - the message to log
Since:
5.0.8

echoGx

public void echoGx(String evtnm,
                   String data,
                   String... any)
Ask the client to echo back globally.

Unlike echo(_global_.String), it will search all browser windows for

Note: this feature requires ZK EE the given desktop IDs.

Parameters:
evtnm - the event name
data - any string-typed data
any - number of desktop IDs.
Since:
5.0.4


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo