I am using SmartGWT 2.2.
I have a REST service that returns a multi-level JSON response. Furthermore, this is not a response that I am simply going to bind to a dynamic form or a grid. I have to do some custom processing of the resulting response. I have set up a Datasource object to issue the REST call via a "fetchData() method call with a DSCallback(). The DSCallback method provides this override:
Through some playing around, I've found that I can get to the javascript object one of two ways:
1. Via the "rawData" object that is passed into the function, like this:
2. Via an element of the "response" object that is passed into the function, like this:
Are either of the two above methods the correct way to do this? If not, what is the correct way? My eventual goal is to cast these javascript objects to Java overlay instances.
Any help would be appreciated.
Thanks,
Alex
I have a REST service that returns a multi-level JSON response. Furthermore, this is not a response that I am simply going to bind to a dynamic form or a grid. I have to do some custom processing of the resulting response. I have set up a Datasource object to issue the REST call via a "fetchData() method call with a DSCallback(). The DSCallback method provides this override:
Code:
@Override public void execute(DSResponse response, Object rawData, DSRequest request)
1. Via the "rawData" object that is passed into the function, like this:
Code:
JavaScriptObject foo = ((JsArray<JavaScriptObject>) rawData).get(0);
Code:
JavaScriptObject foo = response.getData()[0].getJsObj();
Any help would be appreciated.
Thanks,
Alex
Comment