1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    31
    Vote Rating
    0
    yo_haha is on a distinguished road

      0  

    Default Error while showing a window

    Error while showing a window


    Hi,
    I have a button that displays a window when clicking on it :
    Code:
    print = new Ext.Button({
            iconCls: 'print',
            tooltip: "Imprimer la carte",
            handler: function(){    
                printDialog = new Ext.Window({
                    title: "Aperçu avant impression",
                    layout: 'border',
                    items: [mapPanelPrint, formPanel]
                });
                printDialog.setSize(415,355);
                printDialog.on('show', function(){
                    printDialog.center();
                });
                printDialog.show();
            }
        });
    The first click works fine with no problems. When I close the displayed window and click a again on the button, the window does not show and I get an error :
    Code:
    TypeError: me.dom is undefined
    
    style = me.dom.style;
    in file: ext-all-debug-w-comments.js line 10970.
    There is a great chance that this error is linked to the objects inside the window: mapPanelPrint is of type GeoExt.PrintMapPanel() and formPanle is of type Ext.FormPanel that uses mapPanelPrint and another object of type GeoExt.data.PrintPage().
    When I use other objects in the window, this error doesn't appear.

    Do you have a hint?

    Regards.

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    546
    Vote Rating
    52
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    To diagnose whether it is the window causing the error, or one of the children items - try removing the children items (just add a blank panel for example), as test whether the same issue occurs. If no error occurs, add each child item in turn to locate which is causing the issue.

    I'm also not sure why you are applying the setSize and center functions, since you could instead simply add height and width to the window's initial config, and all windows should be centered on show by default anyway?

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    31
    Vote Rating
    0
    yo_haha is on a distinguished road

      0  

    Default


    OK. The window centers by default.
    I tryed what you said about children and, indeed, the errors comes from both children.
    Now I don't know where to post my question about the children error since I didn't find a GeoExt Forum! Would it be fine if I posted in this forum?

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    31
    Vote Rating
    0
    yo_haha is on a distinguished road

      0  

    Default


    I found an answer here : http://www.sencha.com/forum/showthre...2nd-time..-%28

    I moved the components declaration and instantiation into the window and the error disappeared.

Thread Participants: 1