2 Replies Latest reply on Jul 17, 2010 12:04 AM by Flex harUI

    Set System Focus

    lkenney2 Level 1

      I'm using Gaurav's article on styles and popup with Flex 4 as a model for adding popups to a Flex app. The TitleWindow is created using this method:

       

       

      titleWindow = PopUpManager.createPopUp(DisplayObject(systemManager),TitleWindow, true, null) as TitleWindow;

       

       

      This has the advantage to insuring the popup is added to the toplevel of the application. My problem is when the pop-up is closed,I need to put the tabnavigatorback in focus. Right now, ehn you close a popup, you lose the ability to navigate through the tabs. Any ideas?

       

       

       

      http://gauravj.com/blog/2010/03/styles-and-popups-with-flex-4/

        • 1. Re: Set System Focus
          Solydest Level 2

          If you have a CloseEvent event listener as he does in the example to handle removing the popup I believe you could have a line of code in that method utilizing FocusManager to set focus to your tab navigator.  Something like focusManager.setFocus(myTabNavigator).

          • 2. Re: Set System Focus
            Flex harUI Adobe Employee

            In theory it should just work.  Focus may not return to the TabNav, but it

            should return to whatever button was used to popup the popup.

             

            There are some tricky timing issues when setting focus as popups go up or

            down.  Sometimes you have to use callLater to delay setting focus.