PDA

View Full Version : Web Desktop - Ext.MessageBox behind windows



pouniok
24 Aug 2009, 6:12 AM
Hi,


I'm implementing something like the Web Desktop sample in my application, and I found a problem.

I still have no solution, so I would be glad of any help.

When I open more than one window, and click on something to show an Ext messagebox, the messagebox is rendered in the front of the 1st window, but behind all other opened windows.

To reproduce the problem, you can modify the example and add a listener in the grid window like this :



tbar:[{
text:'Add Something',
tooltip:'Add a new row',
iconCls:'add',
listeners: {
onclick: Ext.Msg.alert('test', 'test')
}
},...


Then open some Bogus windows, open the grid window and click "Add Something", and now you have to close all the windows except the first one to see the message box.

Does someone know how to make my messagebox really modal ? (adding modal property didn't do anything)

Thank you.

jay@moduscreate.com
24 Aug 2009, 6:14 AM
dude, you're executing Ext.Msg.alert instead of asigning a reference to it.

pouniok
24 Aug 2009, 6:21 AM
Sorry to hear that I'm doing it wrong, but I don't get what you want to say by reference..?

I'm calling Ext alerts everywhere like this, have I to do something different for the desktop mode ?


Could you give me a hint to test it ?


Thank you again.

jay@moduscreate.com
24 Aug 2009, 12:00 PM
listeners: {
onclick: function() {
Ext.Msg.alert('test', 'test');
}
}

pouniok
24 Aug 2009, 11:28 PM
Thank you for your answers.

I'm sorry, I did my example a little fast; but it doesn't change the background of the problem.


I can paste my own code if it could be more clear. I'm cheking if a form has been changed when I close a window in web desktop.

If it's been changed, I want to show a popup asking if the user really want to close that window.

But the popup appears in the front of the 1st window, but behind all other windows opened.

Here is my code :



var win = MyDesktop.desktop.createWindow({
title: title,
width: 800,
height: 480,
layout: 'fit',
items: container, // It's my form & stuff
iconCls: 'bogus',
shim: false,
animCollapse: false,
constrainHeader: true,
listeners : {
beforeclose: winCloseHandler
}
});

win.show();

function winCloseHandler(panel) {
if (panel.findByType('form').length > 0 && panel.findByType('form')[0].getForm().isDirty() && panel.findByType('form')[0].trackResetOnLoad)
{
Ext.Msg.show({
title: framework_translator['frm.close'],
msg: framework_translator['frm.realy_want_to_close'],
buttons: Ext.Msg.YESNOCANCEL,
modal: true,
fn: function(btn){
if (btn == 'yes') {
panel.un('beforeclose', winCloseHandler);
panel.close();
panel.on('beforeclose', winCloseHandler);
}
},
icon: Ext.MessageBox.QUESTION
});
return false;
}
}


Maybe I can add a CSS class to add a z-index higher (or lower never know ;) ) to show my popup in front of all windows.

But I would prefer a good practice if someone knows how !

Thank you.

moegal
25 Aug 2009, 2:09 AM
what browser are you testing in? Seems ff 2 works fine but 3+ has a problems with the z order of windows esp ones that are modal.

I have not looked but I am sure there is a fix in the forum somewhere.

Marty

pouniok
25 Aug 2009, 7:08 AM
Seems to bug in FF3 - Opera.

Works in IE7.



I'll search for fix in the forums, thank you :)

moegal
25 Aug 2009, 7:55 AM
please let me know, I need it as well.

Marty

Romanitch
9 Sep 2009, 6:25 AM
I have same problem in firefox3,Chrome,Opera,Safari !!!

I have resolved this problem a wile ago by adding this line to my main code:
Ext.WindowMgr.zseed = 10000 // To get it higher then Desktop manager

moegal
9 Sep 2009, 9:05 AM
I have same problem in firefox3,Chrome,Opera,Safari !!!

I have resolved this problem a wile ago by adding this line to my main code:
Ext.WindowMgr.zseed = 10000 // To get it higher then Desktop manager

Are you saying this works now or used to work in v2?

Marty

Romanitch
9 Sep 2009, 10:29 PM
Works now in v3 :)

vandanu
18 Aug 2010, 8:40 PM
how to create window or show another window with handler on tbar