SmartGwt 3.0p 2-16-2012 nightly
Gwt 2.4
Firefox 6.0
I have the following form...
When I press the button I get the following error in my console....
Is there something that I am doing wrong. To my understanding if I have SelectItem.setMultiple(true), and I select more than one entry form the dropdown.... I should be able to do SelectItem.getValues() which returns a String [] of the items that were selected.
Is this correct or am I missing something?
Gwt 2.4
Firefox 6.0
I have the following form...
Code:
final DynamicForm addUserForm = new DynamicForm(); addUserForm.setAutoFocus(true); addUserForm.setNumCols(4); addUserForm.setDataSource(manifestDS); addUserForm.setAddOperation("add_manifest"); addUserForm.setUseAllDataSourceFields(false); addUserForm.setPadding(0); ListGrid pickListProperties = new ListGrid(); pickListProperties.setShowFilterEditor(true); ListGridField fName = new ListGridField("FirstName"); ListGridField lName = new ListGridField("LastName"); ListGridField pos = new ListGridField("Position"); ListGridField dob = new ListGridField("DateOfBirth"); ListGridField passportExp = new ListGridField("PassportExpiration"); final SelectItem employeeName = new SelectItem("EmployeeId"); employeeName.setTitle("Choose Employee"); employeeName.setMultiple(true); employeeName.setOptionDataSource(employeesDS); employeeName.setValueField("EmployeeId"); employeeName.setDisplayField("FirstName"); employeeName.setRequired(true); employeeName.setPickListWidth(450); employeeName.setPickListProperties(pickListProperties); employeeName.setPickListFields(fName, lName, pos, dob, passportExp); ButtonItem newButton = new ButtonItem("addManifest"); newButton.setTitle("Add To Manifest"); newButton.setAlign(Alignment.CENTER); newButton.setWidth(150); newButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { SC.say("n: " + employeeName.getValues().length); } }); addUserForm.setFields(employeeName, newButton);
Code:
22:11:53.796 [ERROR] [testbed] Uncaught exception escaped com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129) at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:248) 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:601) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213) 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:601) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.IllegalArgumentException: Something other than a Java object was returned from JSNI method '@com.smartgwt.client.util.JSOHelper::getArrayValue(Lcom/google/gwt/core/client/JavaScriptObject;I)': 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:271) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.smartgwt.client.util.JSOHelper.getArrayValue(JSOHelper.java) at com.smartgwt.client.util.JSOHelper.convertToJavaStringArray(JSOHelper.java:817) 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:601) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.smartgwt.client.widgets.form.fields.SelectItem.getValues(SelectItem.java) at com.dws.managemymanifest.client.TestBed$1.onClick(TestBed.java:122) at com.smartgwt.client.widgets.form.fields.events.ClickEvent.dispatch(ClickEvent.java:96) at com.smartgwt.client.widgets.form.fields.events.ClickEvent.dispatch(ClickEvent.java:1) at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1) at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40) at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193) at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88) at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127) at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:248) 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:601) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213) 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:601) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:722)
Is this correct or am I missing something?
Comment