Class AuResponse
- Direct Known Subclasses:
AuAlert,AuAppendChild,AuBookmark,AuClearBusy,AuClearWrongValue,AuClientInfo,AuConfirmClose,AuDownload,AuEcho,AuEchoGlobal,AuFocus,AuHistoryState,AuInsertAfter,AuInsertBefore,AuInvoke,AuLoadCSS,AuLoadScript,AuLog,AuMoveBy,AuMoveTo,AuNotification,AuObsolete,AuOuter,AuPrint,AuRemove,AuResizeBy,AuResizeTo,AuResizeWidget,AuScript,AuScrollBy,AuScrollIntoView,AuScrollTo,AuSelect,AuSendRedirect,AuSetAttribute,AuSetAttributes,AuSetTitle,AuShowBusy,AuSubmitForm,AuSyncErrorbox,AuUuid,AuWrongValue
UiEngine.
Application developers rarely need access this class and its derived
directly.
Rather, use Clients instead.
If you prefer to use the derives directly, you can use them with
Execution.addAuResponse(org.zkoss.zk.au.AuResponse).
- Author:
- tomyeh
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Object[]Either String or DeferredValue.static final intZK-Error (5502) indicating the request is aborted, because it is waiting too long for the completion of the previous request.static final intZK-Error (5501) indicating the request is out-of-sequence. -
Constructor Summary
ConstructorsConstructorDescriptionAuResponse(String cmd) Constructs a component-independent response.AuResponse(String cmd, Object data) Constructs a component-independent response.AuResponse(String cmd, Object[] data) Constructs a component-independent response.AuResponse(String cmd, Component depends, Object data) Constructs a response with one or zero data.AuResponse(String cmd, Component depends, Object[] data) Constructs a response with multiple data.AuResponse(String cmd, Page depends, Object data) Constructs a response with single data.AuResponse(String cmd, Page depends, Object[] data) Constructs a response with multiple data. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanReturns the command of this response (never null).final ObjectReturns the component or page that this response depends on.Returns the evaluated result of the associated data of this response (might be null).Returns the override key.Object[]Returns the associated data of this response in the original format (might be null).inthashCode()toString()
-
Field Details
-
SC_OUT_OF_SEQUENCE
public static final int SC_OUT_OF_SEQUENCEZK-Error (5501) indicating the request is out-of-sequence. ZK-Error is returned as the response header of a failed AU request.- Since:
- 5.0.4
- See Also:
-
SC_ACTIVATION_TIMEOUT
public static final int SC_ACTIVATION_TIMEOUTZK-Error (5502) indicating the request is aborted, because it is waiting too long for the completion of the previous request. ZK-Error is returned as the response header of a failed AU request.- Since:
- 6.5.2
- See Also:
-
_cmd
-
_data
Either String or DeferredValue.
-
-
Constructor Details
-
AuResponse
Constructs a component-independent response.- Since:
- 5.0.0 (becomes public)
-
AuResponse
Constructs a component-independent response.- Parameters:
data- the data. It can be null, String, Date, and any kind of objects that the client accepts (marshaled by JSON).- Since:
- 5.0.0 (becomes public)
-
AuResponse
Constructs a component-independent response.- Since:
- 5.0.0 (becomes public)
-
AuResponse
Constructs a response with one or zero data.- Parameters:
depends- specifies whether this response depends on whether the depends component. If depends is not null, this response shall be purged if the depends component is removed. If null, this response is called component-independent, and always sent to the client.Note: info of the depends component doesn't send to the client. It is used only to optimize what responses to send.
data- specifies the data to be sent. If null, no data at all.- Since:
- 5.0.0 (becomes public)
-
AuResponse
Constructs a response with multiple data.- Since:
- 5.0.0 (becomes public)
-
AuResponse
Constructs a response with single data.- Since:
- 5.0.0 (becomes public)
-
AuResponse
Constructs a response with multiple data.- Parameters:
data- an array of data (null to ignore). Each element must be an instance of String,DeferredValueor null.- Throws:
IllegalArgumentException- if an element of data is neither String nor DeferredValue.- Since:
- 5.0.0 (becomes public)
-
-
Method Details
-
getCommand
Returns the command of this response (never null). -
getEncodedData
Returns the evaluated result of the associated data of this response (might be null).Note: when this method is called,
DeferredValuewill be evaluated. Thus, don't call it until the rendering phase. If you want to access it other than the render phase, usegetRawData()instead.Note: it is a copy, so any modification to it won't affect the data of this response.
- Since:
- 5.0.0
- See Also:
-
getRawData
Returns the associated data of this response in the original format (might be null).Note: it is a readonly array. Don't change its value.
- Since:
- 3.0.5
- See Also:
-
getDepends
-
getOverrideKey
Returns the override key. If null, this response will be appended. If not null, it overrides the previous response, if any, with the same override key and the same depends (getDepends()).Default: return null. The derived class shall override this method if it prefers to send the last response in the same category.
Notice that if depends is null and the override key is not null, they are sharing a single namespace of an execution.
Notice that if
AbstractComponent.response(String,AuResponse)is called, this override key is ignored (and the first argument of the invocation is used).- Since:
- 5.0.2
-
hashCode
public int hashCode() -
equals
-
toString
-