PDA

View Full Version : [FIXED] Bug when adding a combo box



zaccret
16 May 2008, 1:17 AM
Hi,

I am trying to add a combobox in a FormPanel. When I click on the combobox to unroll it, I get an exception in the GWT devlopment shell and I can't yet roll/unroll the combobox.

Here is the code :

public void onModuleLoad() {
Viewport viewport = new Viewport();

final FormPanel panel = new FormPanel();
panel.setHeading("Login panel");
panel.setWidth(400);

TextField userTextField = new TextField();
userTextField.setFieldLabel("User name");
panel.add(userTextField);

final ComboBox combo = new ComboBox();
combo.setFieldLabel("File");
final Store store = new Store();
BaseModel model = new BaseModel();
model.set("text", "N/A");
store.add(model);
combo.setWidth(100);
combo.setStore(store);
panel.add(combo);

viewport.add(panel);

RootPanel.get().add(viewport);
}Here is the stack trace :

[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (RangeError): com.google.gwt.dev.shell.HostedModeException: Calling method 'newInstance': attempt to use JavaScript 'undefined' as a value, expected int
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:51)
at com.google.gwt.dev.shell.ie.SwtOleGlue.convertVariantsToObjects(SwtOleGlue.java:57)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:119)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:493)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:417)
at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvokeOnWindow(ModuleSpaceIE6.java:67)
message: com.google.gwt.dev.shell.HostedModeException: Calling method 'newInstance': attempt to use JavaScript 'undefined' as a value, expected int
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:51)
at com.google.gwt.dev.shell.ie.SwtOleGlue.convertVariantsToObjects(SwtOleGlue.java:57)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:119)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:493)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:417)
at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvokeOnWindow(ModuleSpaceIE6.java:67)
number: -2146828279
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:487)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:255)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:105)
at com.extjs.gxt.ui.client.XDOM.getViewportSize(XDOM.java:188)
at com.extjs.gxt.ui.client.widget.form.ComboBox.restrictHeight(ComboBox.java:645)
at com.extjs.gxt.ui.client.widget.form.ComboBox.expand(ComboBox.java:155)
at com.extjs.gxt.ui.client.widget.form.ComboBox.onTriggerClick(ComboBox.java:592)
at com.extjs.gxt.ui.client.widget.form.TriggerField.onTriggerEvent(TriggerField.java:155)
at com.extjs.gxt.ui.client.widget.form.TriggerField$1.onBrowserEvent(TriggerField.java:126)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1306)

zaccret
19 May 2008, 12:27 AM
Mmm. This was in hosted mode.

It works in web mode... So GWT bug ?

darrellmeyer
19 May 2008, 9:16 AM
Your test code works in both host and web mode (ie, ff) with the latest code. Try testing your code again when beta 3 is available which will be later today.

zaccret
20 May 2008, 11:58 PM
It still not works with beta3. The same error in hosted mode :


[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (RangeError): com.google.gwt.dev.shell.HostedModeException: Calling method 'newInstance': attempt to use JavaScript 'undefined' as a value, expected int
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:51)
at com.google.gwt.dev.shell.ie.SwtOleGlue.convertVariantsToObjects(SwtOleGlue.java:57)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:119)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:493)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:417)
at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvokeOnWindow(ModuleSpaceIE6.java:67)
message: com.google.gwt.dev.shell.HostedModeException: Calling method 'newInstance': attempt to use JavaScript 'undefined' as a value, expected int
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:51)
at com.google.gwt.dev.shell.ie.SwtOleGlue.convertVariantsToObjects(SwtOleGlue.java:57)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:119)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:493)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:417)
at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvokeOnWindow(ModuleSpaceIE6.java:67)
number: -2146828279
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:487)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:255)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:105)
at com.extjs.gxt.ui.client.XDOM.getViewportSize(XDOM.java:188)
at com.extjs.gxt.ui.client.widget.form.ComboBox.restrictHeight(ComboBox.java:689)
at com.extjs.gxt.ui.client.widget.form.ComboBox.expand(ComboBox.java:177)
at com.extjs.gxt.ui.client.widget.form.ComboBox.onTriggerClick(ComboBox.java:636)
at com.extjs.gxt.ui.client.widget.form.TriggerField.onTriggerEvent(TriggerField.java:155)
at com.extjs.gxt.ui.client.widget.form.TriggerField$1.onBrowserEvent(TriggerField.java:126)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1306)By the way, it seems to be the same error as http://extjs.com/forum/showthread.php?t=34389 : so it will be OK for RC1 ?

darrellmeyer
21 May 2008, 5:16 AM
What browser, browser version, and OS are you using?


By the way, it seems to be the same error as http://extjs.com/forum/showthread.php?t=34389 : so it will be OK for RC1 ?
It looks like it is the same bug. The change I made will be in RC1.

zaccret
21 May 2008, 5:24 AM
What browser, browser version, and OS are you using?
I'm working on Windows XP. The bug reproduces only in hosted mode. It works in web mode with both Firefox 3 and IE6.