PDA

View Full Version : [FIXED] ClassCastException when resizing Window



cobour
1 Sep 2008, 11:16 AM
The following is working with Mac OS X 10.5.4, GWT 1.5.2 and GXT 1.0.2:

<code>
package de.cobour.testgwt.client;

import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.RootPanel;

/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class TestGWT extends LayoutContainer implements EntryPoint {
public void onModuleLoad() {
RootPanel.get().add(this);
}
@Override
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);
ButtonBar buttons = new ButtonBar();
buttons.add(new Button("Simple",
new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
// empty
}
public void handleEvent(ComponentEvent e) {
Window simple = new Window();
simple.setHeading("Simple Window");
simple.setWidth(250);
simple.setHeight(150);
simple.addText("blablabla");
simple.setScrollMode(Scroll.AUTO);
simple.setMinimizable(true);
simple.show();
}
}));
add(buttons);
setLayout(new FlowLayout(4));
layout();
}
}
</code>


But after replacing GXT with 1.0.3 I get the following Exception when resizing the window:

[ERROR] Uncaught exception escaped
java.lang.ClassCastException: com.extjs.gxt.ui.client.event.ResizeEvent
at com.extjs.gxt.ui.client.widget.Window$5.handleEvent(Window.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:74)
at com.extjs.gxt.ui.client.fx.Resizable.handleMouseDown(Resizable.java:326)
at com.extjs.gxt.ui.client.fx.Resizable.access$0(Resizable.java:321)
at com.extjs.gxt.ui.client.fx.Resizable$ResizeHandle.onBrowserEvent(Resizable.java:97)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1287)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
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.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.mac.MethodDispatch.invoke(MethodDispatch.java:71)
at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2914)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)


Any ideas?

Regards
Frank

darrellmeyer
1 Sep 2008, 8:07 PM
Fix is in SVN and will be available in 1.0.4.

cobour
2 Sep 2008, 9:30 AM
Thanks Darrell !