PDA

View Full Version : widget implementation



wanggwt
3 Jun 2008, 3:29 AM
Hi guys.
I'm new with ext-gwt, and I'm trying to add a timepedia chartPanel to ext-gwt panel, but it was failed. Tracing the code I get:

Ext-Gwt Container class has:

private native void setParent(Widget parent, Widget child) /*-{
child.@com.google.gwt.user.client.ui.Widget::parent = parent;
}-*/;

Standart Gwt Panel has:
void setParent(Widget parent) {
Widget oldParent = this.parent;
if (parent == null) {
if (oldParent != null && oldParent.isAttached()) {
onDetach();
assert !isAttached() : "Failure of " + this.getClass().getName()
+ " to call super.onDetach()";
}
this.parent = null;
} else {
if (oldParent != null) {
throw new IllegalStateException(
"Cannot set a new parent without first clearing the old parent");
}
this.parent = parent;
if (parent.isAttached()) {

onAttach(); ////////// This is important ******************

assert isAttached() : "Failure of " + this.getClass().getName()
+ " to call super.onAttach()";
}
}
}

Should ext-gwt forward the events like the standard gwt-panel? Otherwise compatibility becomes a big issue.

Thanks

gslender
3 Jun 2008, 3:52 AM
would it help to add the chart to a GWT panel and then add that GWT panel to the gxt ContentPanel ??

wanggwt
3 Jun 2008, 4:06 AM
yah, it works, thank you very much.
But it looks like more problems come in after I added the chartPanel to gwt-panel then add gwt-panel to ext-panel. It works nicely until I resize the window then the gwt-panel cannot receive the event any mores. Anyway, I will try to make it work around. :)

Again, thank you for help.

zaccret
11 Jun 2008, 10:20 PM
Did you find a workaround ?