Class DSResponse
- All Implemented Interfaces:
- HasHandlers
DataSource request.  Contains
 all the properties available on the basic RPCResponse, in addition to the properties
 listed here.- 
Field SummaryFields inherited from class com.smartgwt.client.rpc.RPCResponseINVALID_RESPONSE_FORMAT, STATUS_AUTHORIZATION_FAILURE, STATUS_CONNECTION_RESET_ERROR, STATUS_CRITERIA_REQUIRED_ERROR, STATUS_FAILURE, STATUS_FILE_REQUIRED_ERROR, STATUS_LOGIN_INCORRECT, STATUS_LOGIN_REQUIRED, STATUS_LOGIN_SUCCESS, STATUS_MAX_FILE_SIZE_EXCEEDED, STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED, STATUS_MAX_POST_SIZE_EXCEEDED, STATUS_OFFLINE, STATUS_REQUIRED_CRITERIA_MISSING, STATUS_SERVER_TIMEOUT, STATUS_SUCCESS, STATUS_TRANSACTION_FAILED, STATUS_TRANSPORT_ERROR, STATUS_UNKNOWN_HOST_ERROR, STATUS_UPDATE_WITHOUT_PK_ERROR, STATUS_VALIDATION_ERRORFields inherited from class com.smartgwt.client.core.RefDataClassidFields inherited from class com.smartgwt.client.core.DataClassfactoryCreated, factoryProperties
- 
Constructor SummaryConstructorsConstructorDescriptionDSResponse(JavaScriptObject jsObj) DSResponse(String dataSource) DSResponse(String dataSource, DSOperationType operationType) DSResponse(String dataSource, DSOperationType operationType, Record... data) 
- 
Method SummaryModifier and TypeMethodDescriptionRecord[]getData()For "fetch" operations, this is the array of Records fetched.For "fetch" operations, this is the array of Records fetched.The DataSource of this DSResponse.End row of returned server results, when using paged result fetchingServer-side validation errors for an attempted "update" or "add" operation, as a JS Object where each property name is a field name from the record and each property value is an error message to be shown to the user.This attribute may be set for responses whereprogressive loadingis active to indicate the estimated true total row count for the data set.If set, indicates that this response came from the offline cache, not the server.HTTP headers returned by the server as a map from header name to header value.Optional flag that can be set by the server to force ResultSets to drop any caches of records from the DataSource that was the target of the operation.Timestamp (millisecond value) to indicate when this dsResponse was cached inoffline storage.The operation ID of the request corresponding to this DSResponse.The operation type of the request corresponding to this DSResponse.static DSResponsegetOrCreateRef(JavaScriptObject jsObj) This attribute may be set to indicate thatprogressive loading was enabled, for a paged data fetch, and as such thetotal row countis not guaranteed to be accurate.intAn extra property of each DSResponse to a queued request that indicates whether the queue as a whole succeeded.Starting row of returned server results, when using paged result fetchingintSame meaning asRPCResponse.status, except DSResponses have additional error codes, such asvalidation failure.Total number of rows available from the server that match the current filter criteria, when using paged result fetching.voidFor "fetch" operations, this is the array of Records fetched.setDataSource(String dataSource) The DataSource of this DSResponse.voidEnd row of returned server results, when using paged result fetchingvoidsetErrors(JavaScriptObject errors) Server-side validation errors for an attempted "update" or "add" operation, as a JS Object where each property name is a field name from the record and each property value is an error message to be shown to the user.voidServer-side validation errors for an attempted "update" or "add" operation, as a JS Object where each property name is a field name from the record and each property value is an error message to be shown to the user.voidsetInvalidateCache(Boolean invalidateCache) Optional flag that can be set by the server to force ResultSets to drop any caches of records from the DataSource that was the target of the operation.setOperationId(String operationId) The operation ID of the request corresponding to this DSResponse.setOperationType(DSOperationType operationType) The operation type of the request corresponding to this DSResponse.setQueueStatus(int queueStatus) An extra property of each DSResponse to a queued request that indicates whether the queue as a whole succeeded.voidsetStartRow(Integer startRow) Starting row of returned server results, when using paged result fetchingsetStatus(int status) Same meaning asRPCResponse.status, except DSResponses have additional error codes, such asvalidation failure.voidsetTotalRows(Integer totalRows) Total number of rows available from the server that match the current filter criteria, when using paged result fetching.Methods inherited from class com.smartgwt.client.rpc.RPCResponsecreate, getDataAsMap, getDataAsObject, getDataAsString, getHttpResponseCode, getHttpResponseText, getTransactionNum, isDSResponseMethods inherited from class com.smartgwt.client.core.RefDataClassgetRef, getRef, internalSetIDMethods inherited from class com.smartgwt.client.core.DataClassapplyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
- 
Constructor Details- 
DSResponsepublic DSResponse()
- 
DSResponse
- 
DSResponse
- 
DSResponse
- 
DSResponse
 
- 
- 
Method Details- 
getOrCreateRef
- 
getDataFor "fetch" operations, this is the array of Records fetched. For "update", "add", and "remove" operations, this is typically an array containing a single Record representing the record that was updated, added, or removed.- Returns:
- Current data value. Default value is null
 
- 
getDataAsRecordListFor "fetch" operations, this is the array of Records fetched. For "update", "add", and "remove" operations, this is typically an array containing a single Record representing the record that was updated, added, or removed.- Returns:
- Current data value. Default value is null
 
- 
setDataSourceThe DataSource of this DSResponse.- Parameters:
- dataSource- New dataSource value. Default value is null
- Returns:
- DSResponseinstance, for chaining setter calls
 
- 
getDataSourceThe DataSource of this DSResponse.- Returns:
- Current dataSource value. Default value is null
 
- 
getEndRowEnd row of returned server results, when using paged result fetchingNote that startRow and endRow are zero-based, inclusive at the beginning and exclusive at the end (like substring), so startRow: 0, endRow: 2 is a response containing two records. - Returns:
- Current endRow value. Default value is null
 
- 
getEstimatedTotalRowsThis attribute may be set for responses whereprogressive loadingis active to indicate the estimated true total row count for the data set. In progressive loading mode,totalRowscan be thought of as an indication of the last row the user is allowed to request (EG by scrolling through a databound ListGrid), whereasestimatedTotalRowscan convey the server's knowledge of the number of matching rows to the client.This value may be validly set to a String in the following format: - "500+": There are at least 500 records.
- "-500": There are fewer than 500 records.
- "450-500": There are between 450 and 500 records.
- "~500": There are approximately 500 records.
- "500": There are exactly 500 records.
 DataSource.progressiveLoadingThresholdfeature, this property will be populated automatically to an exact value if a row count query was performed and the result exceeded the progressiveLoadingThreshold causing progressiveLoading to be enabled.Developers may also write custom dataSource logic to populate this attribute if desired - Returns:
- Current estimatedTotalRows value. Default value is null
 
- 
getFromOfflineCacheIf set, indicates that this response came from the offline cache, not the server. This flag is the only reliable way for application code to determine the source of a response.- Returns:
- Current fromOfflineCache value. Default value is null
 
- 
getHttpHeadersHTTP headers returned by the server as a map from header name to header value.Headers are available only when the default RPCTransport"xmlHttpRequest" is in use, and browsers may limit access to headers for cross-domain requests or in other security-sensitive scenarios.- Overrides:
- getHttpHeadersin class- RPCResponse
- Returns:
- Current httpHeaders value. Default value is null
 
- 
getInvalidateCacheOptional flag that can be set by the server to force ResultSets to drop any caches of records from the DataSource that was the target of the operation.- Returns:
- Current invalidateCache value. Default value is null
- See Also:
 
- 
getOfflineTimestampTimestamp (millisecond value) to indicate when this dsResponse was cached inoffline storage. Not applicable if the response has never been stored offline.- Returns:
- Current offlineTimestamp value. Default value is null
 
- 
setOperationIdThe operation ID of the request corresponding to this DSResponse.- Parameters:
- operationId- New operationId value. Default value is null
- Returns:
- DSResponseinstance, for chaining setter calls
 
- 
getOperationIdThe operation ID of the request corresponding to this DSResponse.- Returns:
- Current operationId value. Default value is null
 
- 
setOperationTypeThe operation type of the request corresponding to this DSResponse.- Parameters:
- operationType- New operationType value. Default value is null
- Returns:
- DSResponseinstance, for chaining setter calls
 
- 
getOperationTypeThe operation type of the request corresponding to this DSResponse.- Returns:
- Current operationType value. Default value is null
 
- 
getProgressiveLoadingThis attribute may be set to indicate thatprogressive loading was enabled, for a paged data fetch, and as such thetotal row countis not guaranteed to be accurate. Client side code, including theResultSet.lengthIsProgressive()method may make use of this attribute.The Smart GWT server will automatically set this property whenever progressive loading was enabled for the request. - Returns:
- Current progressiveLoading value. Default value is null
 
- 
setQueueStatusAn extra property of each DSResponse to a queued request that indicates whether the queue as a whole succeeded. A queueStatus ofSTATUS_SUCCESS, or 0, indicates that the queue succeeded whereas a queueStatus ofSTATUS_FAILURE, or -1, indicates that the queue failed.For example, if two "update" requests are sent in a queue and the first succeeded, but the second failed validation, then both DSResponses' queueStatus would be -1, but the statusof the first would beSTATUS_SUCCESSand the status of the second would be an error code such asSTATUS_VALIDATION_ERROR.- Parameters:
- queueStatus- New queueStatus value. Default value is see below
- Returns:
- DSResponseinstance, for chaining setter calls
- See Also:
 
- 
getQueueStatuspublic int getQueueStatus()An extra property of each DSResponse to a queued request that indicates whether the queue as a whole succeeded. A queueStatus ofSTATUS_SUCCESS, or 0, indicates that the queue succeeded whereas a queueStatus ofSTATUS_FAILURE, or -1, indicates that the queue failed.For example, if two "update" requests are sent in a queue and the first succeeded, but the second failed validation, then both DSResponses' queueStatus would be -1, but the statusof the first would beSTATUS_SUCCESSand the status of the second would be an error code such asSTATUS_VALIDATION_ERROR.- Returns:
- Current queueStatus value. Default value is see below
- See Also:
 
- 
getStartRowStarting row of returned server results, when using paged result fetchingNote that startRow and endRow are zero-based, inclusive at the beginning and exclusive at the end (like substring), so startRow: 0, endRow: 2 is a response containing two records. - Returns:
- Current startRow value. Default value is null
 
- 
setStatusSame meaning asRPCResponse.status, except DSResponses have additional error codes, such asvalidation failure.- Overrides:
- setStatusin class- RPCResponse
- Parameters:
- status- New status value. Default value is see below
- Returns:
- DSResponseinstance, for chaining setter calls
- See Also:
 
- 
getStatuspublic int getStatus()Same meaning asRPCResponse.status, except DSResponses have additional error codes, such asvalidation failure.- Overrides:
- getStatusin class- RPCResponse
- Returns:
- Current status value. Default value is see below
- See Also:
 
- 
getTotalRowsTotal number of rows available from the server that match the current filter criteria, when using paged result fetching.- Returns:
- Current totalRows value. Default value is null
 
- 
setStartRowStarting row of returned server results, when using paged result fetchingNote that startRow and endRow are zero-based - the first record is row zero. - Parameters:
- startRow- the start row
 
- 
setEndRowEnd row of returned server results, when using paged result fetchingNote that startRow and endRow are zero-based - the first record is row zero. - Parameters:
- endRow- the end row
 
- 
setTotalRowsTotal number of rows available from the server that match the current filter criteria, when using paged result fetching.- Parameters:
- totalRows- total rows
 
- 
setInvalidateCacheOptional flag that can be set by the server to force ResultSets to drop any caches of records from the DataSource that was the target of the operation.- Parameters:
- invalidateCache- invalidateCache
 
- 
setErrorsServer-side validation errors for an attempted "update" or "add" operation, as a JS Object where each property name is a field name from the record and each property value is an error message to be shown to the user. For example:dsResponse.errors = { userId : "A user with this userId already exists", orderId : "No Order with ID '6A18294' exists" }The Java API DSResponse.addError(fieldName, errorMessage) is used to send server-side errors to the client. See the Java Server Reference for details.- Parameters:
- errors- errors map
 
- 
setErrorsServer-side validation errors for an attempted "update" or "add" operation, as a JS Object where each property name is a field name from the record and each property value is an error message to be shown to the user. For example:dsResponse.errors = { userId : "A user with this userId already exists", orderId : "No Order with ID '6A18294' exists" }The Java API DSResponse.addError(fieldName, errorMessage) is used to send server-side errors to the client. See the Java Server Reference for details.- Parameters:
- errors- errors as JavaScriptObject
 
- 
setDataFor "fetch" operations, this is the array of Records fetched. For "update", "add", and "remove" operations, this is typically an array containing a single Record representing the record that was updated, added, or removed.- Parameters:
- data- data Default value is null
 
- 
getErrorsServer-side validation errors for an attempted "update" or "add" operation, as a JS Object where each property name is a field name from the record and each property value is an error message to be shown to the user. For example:{ userId : ["A user with this userId already exists"], orderId : ["Must be a numeric value", "No Order with ID '6A18294' exists"] }The Java API DSResponse.addError(fieldName, errorMessage) is used to send server-side errors to the client. See the Java Server Reference for details.- Returns:
- the errors map
 
 
-