1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
    sdc is on a distinguished road

      0  

    Default [1.2] JavaScriptException when showing a Dialog

    [1.2] JavaScriptException when showing a Dialog


    - 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);
    
    }
    Last edited by sdc; 13 Mar 2009 at 8:35 AM. Reason: longer stack trace

  2. #2
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default


    The line at which FormLayout.renderField is inserting something into its template, there is clearly something going wrong - without knowing what the code is being asked to do (ie your code) its impossible to figure out what.

    Try working out which part of your form is causing this, and then simulate this in a simpler test case that you can provide - if its a bug, then we can fix it. If not a bug, we also might be able to help you get your code corrected.

  3. #3
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
    sdc is on a distinguished road

      0  

    Default


    It is really hard for two reasons :
    • the dialog.show() is called in a button which is in a ContentPanel which is an AdapterField which is in another Dialog.
    • there are some classes in my application on top of gxt
    I am going to refactor my code to bypass our layers and directly call gxt code.

  4. #4
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
    sdc is on a distinguished road

      0  

    Default


    I completely refactored my code to workaround this bug.
    By the way, I found some information by searching on the web about this error, and it seems to happen when you add a block element in an inline element.
    Just to let you know, I never inserted "raw" HTML in my application so I guess something must be (was?) wrong somewhere in GXT. Hope it can helps.

    http://extjs.com/forum/showthread.ph...468#post141468
    http://integralpath.blogs.com/thinki.../03/index.html
    http://www.developersnippets.com/200...his-operation/
    http://groups.google.com/group/dexag...4193af70f1a6d9

    Cheers

  5. #5
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
    sdc is on a distinguished road

      0  

    Default


    I've put a bigger stack trace in my first post.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi