Hi,
Is it possible to send an array with integers with RestDataSource ?
Currently I've done this:
public class XDataSource extends RestDataSource {
public XDataSource()
{
setDataFormat(DSDataFormat.JSON);
setJsonRecordXPath("/");
DataSourceIntegerField idsField = new DataSourceIntegerField("ids");
tripIdsField.setMultiple(true);
setFields(idsField);
// ... The rest of standard setup of the DataSource ..
}
}
When the server responds with the ID's I get the following error in SC Developer Console:
04:05:22,202 [ERROR] 13:12:43.956:XRP6:WARN:RestDataSource:XReportDS:XReportDS.ids: value: Array[20] failed on validator: {type: "isInteger", typeCastValidator: true, _generated: true, defaultErrorMessage: "Must be a whole number."}
com.smartgwt.client.core.JsObject$SGWT_WARN: 13:12:43.956:XRP6:WARN:RestDataSource:XReportDS:XReportDS.ids: value: Array[20] failed on validator: {type: "isInteger",
typeCastValidator: true,
_generated: true,
defaultErrorMessage: "Must be a whole number."} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) at java.lang.Thread.run(Thread.java:619)
So the array is not of type integer. That's correct, but the setMultiple method of DataSourceIntegerField should take care of that ?
Is it possible to send an array with integers with RestDataSource ?
Currently I've done this:
public class XDataSource extends RestDataSource {
public XDataSource()
{
setDataFormat(DSDataFormat.JSON);
setJsonRecordXPath("/");
DataSourceIntegerField idsField = new DataSourceIntegerField("ids");
tripIdsField.setMultiple(true);
setFields(idsField);
// ... The rest of standard setup of the DataSource ..
}
}
When the server responds with the ID's I get the following error in SC Developer Console:
04:05:22,202 [ERROR] 13:12:43.956:XRP6:WARN:RestDataSource:XReportDS:XReportDS.ids: value: Array[20] failed on validator: {type: "isInteger", typeCastValidator: true, _generated: true, defaultErrorMessage: "Must be a whole number."}
com.smartgwt.client.core.JsObject$SGWT_WARN: 13:12:43.956:XRP6:WARN:RestDataSource:XReportDS:XReportDS.ids: value: Array[20] failed on validator: {type: "isInteger",
typeCastValidator: true,
_generated: true,
defaultErrorMessage: "Must be a whole number."} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) at java.lang.Thread.run(Thread.java:619)
So the array is not of type integer. That's correct, but the setMultiple method of DataSourceIntegerField should take care of that ?
Comment