Hi,
Context: on a datasource, I am checking the request for a criteria to filter on field "id". If no filter given, I just fetch everything.
executeFetch(String requestId, DSRequest request, DSResponse response)
I was trying a simple request.getCriteria().getAttribute("id");
but this gives me a nullpointer somewhere.
This happens in the case when no filter is given, and therefore no criteria has been given (any).
After some searching I found this to be true:
request.getCriteria() != null
request.getCriteria().getJsObj() == null
Can someone explain why the Criteria is not null, but its javaScriptObject is?
Or do I have to live with it and always check (in java) the javaScriptObject and not the java object?
Context: on a datasource, I am checking the request for a criteria to filter on field "id". If no filter given, I just fetch everything.
executeFetch(String requestId, DSRequest request, DSResponse response)
I was trying a simple request.getCriteria().getAttribute("id");
but this gives me a nullpointer somewhere.
This happens in the case when no filter is given, and therefore no criteria has been given (any).
After some searching I found this to be true:
request.getCriteria() != null
request.getCriteria().getJsObj() == null
Code:
[DEBUG] Uncaught exception com.google.gwt.core.client.JavaScriptException: (TypeError): 'null' is null or not an object number: -2146823281 description: 'null' is null or not an object at com.smartgwt.client.util.JSOHelper.getAttribute(Native Method) at com.smartgwt.client.core.DataClass.getAttribute(DataClass.java:51)
Or do I have to live with it and always check (in java) the javaScriptObject and not the java object?
Comment