PDA

View Full Version : Ext.BasicDialog: closing window doesn't give focus to underlying windows


lenzb
04-27-2007, 07:14 PM
We are using Ext.BasicDialog for many popup windows in our application. Oftentimes, there can be more than one popup window displayed on the screen at a time. We attach the <esc> key as a keyListener to each of our BasicDialogs to allow the windows to be closed with a keypress.

After closing one window, whatever underlying window there may be will not regain focus and thus will not respond to the <esc> key for closing. Here's a scenario:

- Open multiple popups
- Close the topmost popup (either with <esc> or by using the "X")
- Hitting <esc> to close the next topmost window will not close the window (as I believe it should)

This doesn't work because upon closing a window, the next topmost window is not given focus. If I do something to give it focus (either via a direct javascript call to the focus() method via Firebug console or by dragging the window on the page), then the <esc> key will close the window appropriately. Thus, I think the fix is to just give focus to the next topmost window after hiding a window.

I would have added a hook into the Ext.DialogManager to handle doing this for me, but the internal "list" and "accessList" attributes of the DialogManager are not exposed in any way, so my hands are tied (short of modifying ext source, which I'd rather not do).

Do you agree this is a bug? Is there any other alternative to my problem that I am not seeing?

Thanks in advance for your help :)

Brian

Animal
04-28-2007, 04:48 AM
It would be a fairly easy enhancement to the Ext.DialogManager object to bring to front and focus the next non-hidden dialog down the z-order upon close of a dialog.

I'd suggest submitting an enhancement request.

thesilentman
05-06-2007, 06:20 AM
FYI, I just submitted the official request for it here: http://extjs.com/forum/showthread.php?t=5781

lenzb
05-06-2007, 01:51 PM
Thanks, silentman! :)

thesilentman
05-17-2007, 10:03 AM
I made some desktop like functionality over here: http://extjs.com/forum/showthread.php?t=6355

It has the focus issue solved. You might want to check it out and reuse some code from that.
Greetings,
Frank