I get the following error when adding a widget that is a child of a
HTMLPanel is removed from his parent:
(TypeError): this.removeChild is not a function
The full error is listed below.

What I do (gwt 2.1.0):
Create a HTMLPanel from a string and then iterate through all elements
and add RadioButtons on determined places. I store references to the
RadioButtons in a List so I can reuse them on a refresh.
On a refresh, I iterate again through the HTMLPanel elements an add
again the stored RadioButtons. On this refresh I get an error when the
RadioButton tries to remove him self from his parent.
In a code snippet:
iterating through all HTMLPanel elements:
                        final RadioButton child = getNextCachedRadioButton()
                        child.removeFromParent();
                        htmlPanel.add(child, cell);

The error occurs when calling child.removeFromParent() in the refresh
when it's already a child of the HTMLPanel (not the first time when
it's not a child of the HTMLPanel yet)...
Any idea why the error occurs? I this a bug?

Thrown exception part:
----
Caused by: com.google.gwt.core.client.JavaScriptException:
(TypeError): this.removeChild is not a function
 fileName: http://127.0.0.1:8888
 lineNumber: 104
 stack: ([object HTMLSpanElement])@http://127.0.0.1:8888:104
@:0
(null,655430,[object MouseEvent],[object HTMLDivElement],[object
GWTJavaObject])@http://127.0.0.1:8888/serviceplus/hosted.html?
serviceplus:56
([object MouseEvent])@http://127.0.0.1:8888:161
((function (evt) {var listener, curElem = this;while (curElem && !
(listener = curElem.__listener)) {curElem = curElem.parentNode;}if
(curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if
(__gwt_makeJavaInvoke(1)(null, 589942, listener))
{__gwt_makeJavaInvoke(3)(null, 655430, evt, curElem, listener);}}}),
[object HTMLDivElement],[object Object])@http://127.0.0.1:8888:66
@:0
(null,106,(function (evt) {var listener, curElem = this;while (curElem
&& !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if
(curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if
(__gwt_makeJavaInvoke(1)(null, 589942, listener))
{__gwt_makeJavaInvoke(3)(null, 655430, evt, curElem, listener);}}}),
[object HTMLDivElement],[object Object])@http://127.0.0.1:8888/
serviceplus/hosted.html?serviceplus:56
([object MouseEvent])@http://127.0.0.1:8888:20

    at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
237)
    at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
126)
    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.dom.client.Node$.removeChild$(Node.java)
    at com.google.gwt.user.client.DOM.removeChild(DOM.java:992)
    at
com.google.gwt.user.client.ui.ComplexPanel.remove(ComplexPanel.java:
71)
    at
com.google.gwt.user.client.ui.Widget.removeFromParent(Widget.java:180)




-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to