PopupPanel throwing Exception on IE6

11 views
Skip to first unread message

georgeuoa

unread,
May 30, 2006, 7:09:25 AM5/30/06
to Google Web Toolkit
This crashes on IE6 (but not on firefox):

public class PopupMenu extends PopupPanel {

private Grid panel = new Grid();

public PopupMenu(){
panel.resize(3, 1);
panel.setWidget(0, 0, ...);
setStyleName("Popup-Panel");
setWidget(panel);
}

I've seen a workaround adding a HTML before the setWidget(panel)

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/377d53425fcfc3dd/79fd044cdce51733

but when I tried it, it only shows the HTML, not the widget.

<exception>
[ERROR] Uncaught exception escaped
java.lang.RuntimeException: JavaScript method
'@com.google.gwt.user.client.ui.impl.PopupImplIE6::setClassName(Lcom/google/gwt/user/client/Element;Ljava/lang/String;)'
threw an exception
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.java:394)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeVoid(ModuleSpaceIE6.java:283)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:127)
at
com.google.gwt.user.client.ui.impl.PopupImplIE6.setClassName(PopupImplIE6.java:39)
at
com.google.gwt.user.client.ui.PopupPanel.setStyleName(PopupPanel.java:194)
at idocs.pati.web.gwt.client.PopupMenu.<init>(PopupMenu.java:80)
at
idocs.pati.web.gwt.client.TableHeader$1.onClick(TableHeader.java:19)
at
com.google.gwt.user.client.ui.ClickListenerCollection.fireClick(ClickListenerCollection.java:36)
at
com.google.gwt.user.client.ui.Hyperlink.onBrowserEvent(Hyperlink.java:118)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:902)
Caused by: com.google.gwt.core.client.JavaScriptException: JavaScript
TypeError exception: 'children.1' is null or not an object
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
com.google.gwt.dev.shell.ModuleSpace.createJavaScriptException(ModuleSpace.java:267)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.exceptionCaught(ModuleSpaceIE6.java:105)
at
com.google.gwt.dev.shell.JavaScriptHost.exceptionCaught(JavaScriptHost.java:31)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.google.gwt.dev.shell.StaticJavaDispatch.callMethod(StaticJavaDispatch.java:45)
</exception>

georgeuoa

unread,
May 30, 2006, 7:17:04 AM5/30/06
to Google Web Toolkit
addStyleName() however seems to work fine...

bakke...@gmail.com

unread,
May 30, 2006, 9:58:27 AM5/30/06
to Google Web Toolkit
I had the same error also with the popup panel. I could not pin point
the exact problem

yerayca...@gmail.com

unread,
Jun 12, 2006, 11:41:07 AM6/12/06
to Google Web Toolkit
When you want to display a PopupPanel on screen. PopupPanel try to
apply settings to his childs before apply settings to himself. For
example:

public void onModuleLoad() {
PopupPanel popup = new PopupPanel();
popup.setWidth("100px");
popup.setPopupPosition(200, 300);
RootPanel.get("popup").add(popup);
}

This sample threw an exception java.lang.RuntimeException: JavaScript
method
'@com.google.gwt.user.client.ui.impl.PopupImplIE6::setWidth(Lcom/google/gwt/user/client/Element;Ljava/lang/String;)'
threw an exception

PopupPanel hasn't childs so a Exception will be threw. The same
situation happens when you try to set position of a PopupPanel which
hasn't childs.

This is a strange behavior. Maybe this is a bug.

The next code will run perfectly.

public void onModuleLoad() {
PopupPanel popup = new PopupPanel();
popup.addWidget(new Label("Hello world GWT"));
popup.setWidth("100px");
popup.setPopupPosition(200, 300);
RootPanel.get("popup").add(popup);
}

Reply all
Reply to author
Forward
0 new messages