JSON Structure as below:
and in MyRestDataSource class, the method transformResponse as below:
But errors' size is 0, seems like the DSResponse didn't get error message from JSON data.
Anyone could help me ? I just want to display error message which JSON Data contains.
Thank you very much
Code:
{ "response":{ "status":-1, "startRow":0, "endRow":0, "totalRows":0, "errors":{"SQL":"SQL Syntax ERROR"}, "data":[] } }
Code:
protected void transformResponse(DSResponse response, DSRequest request, Object data) { Map errors = response.getErrors(); if(errors != null && errors.size() > 0 ){ Window.alert(errors.get("SQL").toString()); } super.transformResponse(response, request, data); }
Anyone could help me ? I just want to display error message which JSON Data contains.
Thank you very much
Comment