-
18 Oct 2012 1:20 AM #1
Error while showing a window
Error while showing a window
Hi,
I have a button that displays a window when clicking on it :
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: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(); } });
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().Code:TypeError: me.dom is undefined
in file: ext-all-debug-w-comments.js line 10970.style = me.dom.style;
When I use other objects in the window, this error doesn't appear.
Do you have a hint?
Regards.
-
18 Oct 2012 1:27 AM #2
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?
-
18 Oct 2012 2:02 AM #3
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?
-
18 Oct 2012 4:26 AM #4
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.


Reply With Quote