PDA

View Full Version : [2.0b1] Ext.MessageBox / safari



xgdlm
18 Oct 2007, 9:48 PM
Hello,

Ext.MessageBox aren't display on the top of all other windows using safari web browser.

xav

evant
18 Oct 2007, 9:55 PM
Can you please post more information? See this thread: http://extjs.com/forum/showthread.php?t=13985

xgdlm
18 Oct 2007, 10:22 PM
Here are the details:

the probleme occures when two windows are open. if a single window is open there is no problem.

Safari build : 2.0.4 (419.3)

Html page :




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Ext 2.0 Desktop Sample App</title>

<link rel="stylesheet" type="text/css" href="http://extjs.com/deploy/dev/resources/css/ext-all.css" />
<script type="text/javascript" src="http://extjs.com/deploy/dev/adapter/ext/ext-base.js"></script>

<!-- ENDLIBS -->

<script type="text/javascript" src="http://extjs.com/deploy/dev/ext-all.js"></script>

<!-- DESKTOP -->
<script type="text/javascript" src="http://extjs.com/deploy/dev/examples/desktop/js/StartMenu.js"></script>
<script type="text/javascript" src="http://extjs.com/deploy/dev/examples/desktop/js/TaskBar.js"></script>
<script type="text/javascript" src="http://extjs.com/deploy/dev/examples/desktop/js/Desktop.js"></script>

<script type="text/javascript" src="http://extjs.com/deploy/dev/examples/desktop/js/App.js"></script>
<script type="text/javascript" src="http://extjs.com/deploy/dev/examples/desktop/js/Module.js"></script>
<script type="text/javascript" src="/static/sample.js"></script>

<link rel="stylesheet" type="text/css" href="http://extjs.com/deploy/dev/examples/desktop/css/desktop.css" />
</head>
<body scroll="no">

<div id="x-desktop">
<a href="http://extjs.com" target="_blank" style="margin:5px; float:right;"><img src="images/powered.gif" /></a>

<dl id="x-shortcuts">
<dt id="grid-win-shortcut">
<a href="#"><img src="images/s.gif" />
<div>Grid Window</div></a>
</dt>
<dt id="acc-win-shortcut">
<a href="#"><img src="images/s.gif" />
<div>Accordion Window</div></a>

</dt>
</dl>
</div>

<div id="ux-taskbar">
<div id="ux-taskbar-start"></div>
<div id="ux-taskbuttons-panel"></div>
<div class="x-clear"></div>
</div>

</body>
</html>

sample.js




/*
* Ext JS Library 2.0 Beta 1
* Copyright(c) 2006-2007, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/


// Sample desktop configuration
MyDesktop = new Ext.app.App({
init :function(){
Ext.QuickTips.init();
},

getModules : function(){
return [
new MyDesktop.BogusModule(),
new MyDesktop.BogusModule2()
];
},

// config for the start menu
getStartConfig : function(){
return {
title: 'Jack Slocum',
iconCls: 'user',
toolItems: [{
text:'Settings',
iconCls:'settings',
scope:this
},'-',{
text:'Logout',
iconCls:'logout',
scope:this
}]
};
}
});


// for example purposes
var windowIndex = 0;

MyDesktop.BogusModule = Ext.extend(Ext.app.Module, {
init : function(){
this.launcher = {
text: 'Window '+(++windowIndex),
iconCls:'bogus',
handler : this.createWindow,
scope: this,
windowId:windowIndex
}
},

createWindow : function(src){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('bogus'+src.windowId);
if(!win){
win = desktop.createWindow({
id: 'bogus'+src.windowId,
title:src.text,
width:640,
height:480,
html : '<p><b>Confirm</b><br />Standard Yes/No dialog<button id="mb1">Show</button></p>',
iconCls: 'bogus',
shim:false,
animCollapse:false,
constrainHeader:true
});
}

Ext.get('mb1').on('click', function(e){
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?');
});

win.show();
}
});


MyDesktop.BogusModule2 = Ext.extend(Ext.app.Module, {
init : function(){
this.launcher = {
text: 'Window '+(++windowIndex),
iconCls:'bogus',
handler : this.createWindow,
scope: this,
windowId:windowIndex
}
},

createWindow : function(src){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('bogus'+src.windowId);
if(!win){
win = desktop.createWindow({
id: 'bogus'+src.windowId,
title:src.text,
width:640,
height:480,
html : 'zzzzzzzzzzzzzzzzzzzz',
iconCls: 'bogus',
shim:false,
animCollapse:false,
constrainHeader:true
});
}


win.show();
}
});

DragonFist
6 Dec 2007, 9:22 AM
I just ran into this one with Ext2.0 final.

Any work arounds?

Best,

Shawn

tryanDLS
6 Dec 2007, 9:29 AM
Messagebox is a singleton, you should only have 1 open at a time. If you really want multiple modal windows, you should use the Window class.

DragonFist
6 Dec 2007, 10:27 AM
I am sorry, I may have misunderstood the original problem.

I don't need multiple messageboxes. My problem is that in safari, if there are more than one desktop windows open, a messagebox shows behind the window that it was called from, hidding it from the user.

DragonFist
6 Dec 2007, 11:05 AM
I found the work-around.

in the desktop.js (or whereever you are calling a windowsmanager) set the window manager zseed to something lower than 9000 like this:

var windows = new Ext.WindowGroup();
windows.zseed = 7000;

as apparently safari sets the z-index of a child appended to document.body to 9003 and if your windowmanager is using the default of 9000 for its seed, any window after the first will be above that.

Hope it helps others,

Shawn

xgdlm
9 Dec 2007, 8:56 PM
Interesting ... thx for the workaround :)

yuki
6 Apr 2008, 8:12 AM
This worked for my code, too! Thanks for the workaround!

JRock
3 Jul 2008, 7:27 AM
Thanks!!! This worked for me too!!

iryndin
26 Sep 2009, 2:47 AM
Thanks, this help me too. Firefox 3.0.14
Great!

bobvandell
5 Dec 2009, 12:15 AM
Another Firefox developer thanking you for this work-around. =D>