The Flex Framework has some built-in functionality around popups. In
general, you should not need to call FocusManager.activate() or
SystemManager.activate() unless you are in some unexpected scenario.
I modified your example and it seemed to work correctly for me. Here
are the changes I made:
SimplePopUp.mxml
private function fClose():void
{
PopUpManager.removePopUp(this);
if (m_pParent is CMyPanel)
{
//
CMyPanel(m_pParent).fSetFocus();
}
}
CMyPanel.as
public function fSetFocus():void
{
PopUpManager.centerPopUp(this);
//var fm:FocusManager = new FocusManager(this);
//fm.activate();
//fm.setFocus(m_InitialFocus as IFocusManagerComponent);
m_InitialFocus.setFocus();
//fm.showFocus();
//systemManager.activate(this);
m_bFocused = true;
}
-Alex
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Dmitri Girski
Sent: Wednesday, February 20, 2008 3:16 PM
To: [email protected]
Subject: [flexcoders] Re: Problem with focus in secondary popups
Hi Alex,
I have created a simple test case:
http://mitek.id.au/TestPopUpSimple.html
<http://mitek.id.au/TestPopUpSimple.html>
Source:
http://mitek.id.au/PopupFocus.zip <http://mitek.id.au/PopupFocus.zip>
http://mitek.id.au/CMyPanel.as <http://mitek.id.au/CMyPanel.as> - is
the base class for the popup
window - it performs all the focusing stuff.
Actually this class can focusing without any problem BUT only if
popups are created automatically in one go.
As soon as you use button clicks to create popups - TAB focus is stuck
in the first one and it won't be restored ever.
Even if you close all popups and start it over again.
NB updateComplete listener - is not essential in this particular case,
but I need in because I use my own caching popupmanager where popups
are reused and then creationComplete won't be dispatched for them
http://mitek.id.au/SimplePopUp.mxml
<http://mitek.id.au/SimplePopUp.mxml> - derived from CMyPanel - just
handles 2 buttons - New and Close
http://mitek.id.au/TestPopUpSimple.mxml
<http://mitek.id.au/TestPopUpSimple.mxml> - main app.
Just run it, then press New and then press TAB - cursor will move in
the first popup, but selection will be in the second popup.
Could you please have a look at this problem?
Thanks!
Dmitri.
--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> systemManager.activate
>