com.smartgwt.client.data
Class DSResponse

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
          extended by com.smartgwt.client.rpc.RPCResponse
              extended by com.smartgwt.client.data.DSResponse

public class DSResponse
extends RPCResponse

Response sent by the server in response to a DSRequest. Contains all the properties available on the basic RPCResponse, in addition to the properties listed here.


Field Summary
 
Fields inherited from class com.smartgwt.client.rpc.RPCResponse
STATUS_FAILURE, STATUS_LOGIN_INCORRECT, STATUS_LOGIN_REQUIRED, STATUS_LOGIN_SUCCESS, STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED, STATUS_SERVER_TIMEOUT, STATUS_SUCCESS, STATUS_TRANSPORT_ERROR, STATUS_VALIDATION_ERROR
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
DSResponse()
           
DSResponse(JavaScriptObject jsObj)
           
 
Method Summary
 Record[] getData()
          Return the data as an array of Records.
 RecordList getDataAsRecordList()
          Return the data as a RecordList.
 Integer getEndRow()
          End row of returned server results, when using paged result fetching
 Map getErrors()
          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.
 Boolean getInvalidateCache()
          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.
static DSResponse getOrCreateRef(JavaScriptObject jsObj)
           
 Integer getStartRow()
          Starting row of returned server results, when using paged result fetching
 Integer getTotalRows()
          Total number of rows available from the server that match the current filter criteria, when using paged result fetching.
 void setData(Record[] data)
          For DataSource operations, this is typically either an Array of records representing records (for "fetch" operations) or a array of a single record representing the updated record (for "update", "add" or "remove" operations).
 void setEndRow(Integer endRow)
          End row of returned server results, when using paged result fetching
 void setErrors(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.
 void setErrors(Map 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.
 void setInvalidateCache(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.
 void setStartRow(Integer startRow)
          Starting row of returned server results, when using paged result fetching
 void setTotalRows(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.RPCResponse
getHttpResponseCode, getStatus, getTransactionNum, setStatus
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsObject, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute
 
Methods inherited from class com.smartgwt.client.core.JsObject
isCreated, setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSResponse

public DSResponse()

DSResponse

public DSResponse(JavaScriptObject jsObj)
Method Detail

getOrCreateRef

public static DSResponse getOrCreateRef(JavaScriptObject jsObj)

getStartRow

public Integer getStartRow()
Starting row of returned server results, when using paged result fetching

Note that startRow and endRow are zero-based - the first record is row zero.

Returns:
Integer

getEndRow

public Integer getEndRow()
End row of returned server results, when using paged result fetching

Note that startRow and endRow are zero-based - the first record is row zero.

Returns:
Integer

getTotalRows

public Integer getTotalRows()
Total number of rows available from the server that match the current filter criteria, when using paged result fetching.

Returns:
Integer

getInvalidateCache

public Boolean getInvalidateCache()
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.

Returns:
Boolean

setStartRow

public void setStartRow(Integer startRow)
Starting row of returned server results, when using paged result fetching

Note that startRow and endRow are zero-based - the first record is row zero.

Parameters:
startRow - the start row

setEndRow

public void setEndRow(Integer endRow)
End row of returned server results, when using paged result fetching

Note that startRow and endRow are zero-based - the first record is row zero.

Parameters:
endRow - the end row

setTotalRows

public void setTotalRows(Integer totalRows)
Total number of rows available from the server that match the current filter criteria, when using paged result fetching.

Parameters:
totalRows - total rows

setInvalidateCache

public void setInvalidateCache(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.

Parameters:
invalidateCache - invalidateCache

setErrors

public void setErrors(Map 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. 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

setErrors

public void setErrors(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. 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

getErrors

public Map getErrors()
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. 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.

Returns:
the errors map

setData

public void setData(Record[] data)
For DataSource operations, this is typically either an Array of records representing records (for "fetch" operations) or a array of a single record representing the updated record (for "update", "add" or "remove" operations).

Parameters:
data - the data

getData

public Record[] getData()
Return the data as an array of Records.

Returns:
the data

getDataAsRecordList

public RecordList getDataAsRecordList()
Return the data as a RecordList.

Returns:
the data