Since switching to version 4.1 from 4.0 we noticed the following change:
The following code prints 1 on a Record:
While it throws an exception on a FormItem:
This is the exception
This was tested with GWT 2.6 on the latest nightly of 4.1
The following code prints 1 on a Record:
Code:
Record record = new Record();
record.setAttribute("test", 1); //setting an integer
System.err.println(record.getAttribute("test")); //getting as a stringCode:
FormItem formItem = new FormItem();
formItem.setAttribute("test", 1); //setting an integer
System.err.println(formItem.getAttribute("test")); //getting as a stringCode:
java.lang.IllegalArgumentException: Something other than a Java object was returned from JSNI method '@com.smartgwt.client.widgets.form.fields.FormItem::getAttributeAsObject(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)': JS value of type int, expected java.lang.Object
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:178)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:286)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.smartgwt.client.widgets.form.fields.FormItem.getAttributeAsObject(FormItem.java)
at com.smartgwt.client.widgets.form.fields.FormItem.getAttributeAsString(FormItem.java:5092)
at com.smartgwt.client.widgets.form.fields.FormItem.getAttribute(FormItem.java:5088)
at com.genohm.slims.client.gui.Slims.onModuleLoad(Slims.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:411)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Thread.java:724)