I'm not clear which component  you are trying to give focus to.  Is it
in the main app?  If you can post a mini-example we can take a look.  In
general, the framework should take care of restoring focus so you
shouldn't have had to add any code.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Matt
Sent: Friday, February 22, 2008 10:45 AM
To: [email protected]
Subject: [flexcoders] Adventures in Focus Management

 

Despite my spiffy title, this is a very frustrating issue I'm dealing
with. I am clicking a button that uses PopUpManager to display a
Container that contains items that can be clicked on. Upon click an
item is selected and the Container is set to be invisible (NOTE: I'm not
using PopUpManager.removePopUp(...)). My problem is that even though I
try to give focus back to the component via component.setFocus(), it
does not receive tab focus like it should. I can tab perpetually and
nothing ever highlights. If I click back onto the application or any
component within the application I then get focus back, but only by
physically clicking. It would appear this is PopUpManager applying
another FocusManager for the popup container and not giving preference
back to the default FocusManager upon setFocus(). However, I cannot
seem to figure out a way to programmatically tell it to give focus back
to the default FocusManager.

What I have tried:

ISystemManager(component['systemManager']).activate(IFocusManagerContain
\
er(parentComponent));
IFocusManager(component['focusManager']).setFocus(IFocusManagerComponent
\
(component));
IFocusManager(component['focusManager']).showFocus();

That code doesn't highlight, nor does it give tab focus. If I click a
button that explicitly calls this it works, but I believe that's simply
because by clicking on the Button the default FocusManager is activated.
Help would be greatly appreciated.

 

Reply via email to