- GXT version : 1.2
- GWT version : 1.5.3
- hosted mode and web mode
- Browser and version : IE6 (no problem in FF3)
- Operating System : Windows XP
- Detailed description of the problem :
I try to show a complex dialog containing a form panel and I get a JavaScriptException. Unfortunately, it is very very hard to reproduce the bug in a few lines of code.
Here is the stack trace :
Code:
[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (Error): Invalid source HTML for this operation.
number: -2146827687
description: Invalid source HTML for this operation.
at com.extjs.gxt.ui.client.core.Template.appendInternal(Native Method)
at com.extjs.gxt.ui.client.core.Template.insert(Template.java:165)
at com.extjs.gxt.ui.client.widget.layout.FormLayout.renderField(FormLayout.java:314)
at com.extjs.gxt.ui.client.widget.layout.FormLayout.renderComponent(FormLayout.java:279)
at com.extjs.gxt.ui.client.widget.Layout.renderAll(Layout.java:228)
at com.extjs.gxt.ui.client.widget.Layout.onLayout(Layout.java:212)
at com.extjs.gxt.ui.client.widget.layout.AnchorLayout.onLayout(AnchorLayout.java:73)
at com.extjs.gxt.ui.client.widget.layout.FormLayout.onLayout(FormLayout.java:260)
at com.extjs.gxt.ui.client.widget.Layout.layout(Layout.java:91)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:348)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:443)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:238)
at com.extjs.gxt.ui.client.widget.Container.onAttach(Container.java:454)
at com.extjs.gxt.ui.client.widget.form.FormPanel.onAttach(FormPanel.java:438)
at com.extjs.gxt.ui.client.widget.ComponentHelper.doAttach(ComponentHelper.java:24)
at MyFieldAdapter.doAttachChildren(FieldAdapter.java:63)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:111)
at com.extjs.gxt.ui.client.widget.Component.onAttach(Component.java:1264)
at com.extjs.gxt.ui.client.widget.ComponentHelper.doAttach(ComponentHelper.java:24)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:352)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:443)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:238)
at com.extjs.gxt.ui.client.widget.Container.onAttach(Container.java:454)
at com.extjs.gxt.ui.client.widget.form.FormPanel.onAttach(FormPanel.java:438)
at com.extjs.gxt.ui.client.widget.ComponentHelper.doAttach(ComponentHelper.java:24)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:352)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:443)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:238)
at com.extjs.gxt.ui.client.widget.Window.layout(Window.java:527)
at com.extjs.gxt.ui.client.widget.Window.afterShow(Window.java:869)
at com.extjs.gxt.ui.client.widget.Window.show(Window.java:836)
...
and MyFieldAdapter is :
Code:
public abstract class FieldAdapter<T extends Serializable> extends Field<T> {
public static abstract class FieldAdapterParams implements IFieldParams {
static final long serialVersionUID = 1L;
public void parameterize(Field<?> field) {
}
}
/**
* The wrapped widget.
*/
protected Widget widget;
FieldAdapter() {
}
/**
* Creates a new adapter field.
*
* @param widget
* the widget to be wrapped
*/
public FieldAdapter(FieldAdapterParams params) {
super();
this.widget = createWidget(params);
}
protected abstract Widget createWidget(FieldAdapterParams params);
/**
* Returns the wrapped widget.
*
* @return the widget
*/
public Widget getWidget() {
return widget;
}
@Override
public boolean isValid() {
return true;
}
@Override
public void forceInvalid(String msg) {
}
@Override
protected void doAttachChildren() {
super.doAttachChildren();
ComponentHelper.doAttach(widget);
}
@Override
protected void doDetachChildren() {
super.doDetachChildren();
ComponentHelper.doDetach(widget);
}
@Override
protected void onRender(Element target, int index) {
setElement(widget.getElement(), target, index);
if (widget instanceof Component) {
Component c = (Component) widget;
if (!c.isRendered()) {
c.render(target, index);
}
}
}
/**
* The value is returned by the widget
*
* @see com.extjs.gxt.ui.client.widget.form.Field#getValue()
*/
@Override
public final T getValue() {
return doGetValueFromWidget();
}
@Override
public final void setValue(T value) {
doSetValueInWidget(value);
}
protected abstract T doGetValueFromWidget();
protected abstract void doSetValueInWidget(T value);
}