Opensocial.DataResponse (v0.8)
From OpenSocial
opensocial.DataResponse
This object contains the requested server data mapped to the requested keys.
See also: opensocial.DataRequest
Methods
get
-
opensocial.ResponseItem get(key) - Gets the ResponseItem for the requested field.
- Parameters
-
keythe string specified in the corresponding data request item. - Returns
-
opensocial.ResponseItemThe requested response calculated by the server
-
getErrorMessage
-
String getErrorMessage() - If the entire request had a batch level error, returns the error message.
- Returns
-
StringA human-readable description of the error that occurred.
-
hadError
-
Boolean hadError() - Returns true if there was an error in fetching this data from the server.
- Returns
-
BooleanTrue if there was an error; otherwise, false
-
Examples
function response(data) { if (data.hadError()) { output("Error: " + data.get("req").getErrorMessage()); } else { output(data.get("req").getData().getDisplayName()); } gadgets.window.adjustHeight(); }; function request() { var req = opensocial.newDataRequest(); req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER), "req"); req.send(response); };
|
OpenSocial 0.8 |
|||
|
opensocial.CreateActivityPriority opensocial.DataResponse |
|||
