I've created a simple test to replicate this problem: test.mxml
<http://captiveimagination.com/download/test.mxml>

When the page loads it will display two buttons: "Test" and "Test 2". 
If you click on "Test" a "Floating" button will appear in the top left
of the page. If you then click on the "Floating" button it will then
disappear and focus will be lost from the application until you
explicitly click back into the application. My problem is that I want to
explicitly give focus back to the "Test" button, but it refuses to get
it back and no matter how many times I hit tab, it never gets back to
any component. This is why I think it's another FocusManager that's
keeping me from being about to function, but I want to figure out a way
to force focus back to my application's FocusManager.

Thanks,

Matt Hicks

--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> 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