4 Replies Latest reply on Aug 26, 2011 1:19 AM by Porratic

    FocusManager problem when closing a Pop-up

    Porratic

      Hi all. I'm developing a modular application (with FLEX 4.5 and SPARK) that loads the different modules of the application inside a ModuleLoader.

       

      In one of this modules I use a custom component that shows TitleWindow in a Popup using the PopupManager:

       

      //Crear el diálogo de selección

      var dialogo:DataGridSelectorDialog = new DataGridSelectorDialog();

      dialogo.selector = this;

       

       

      //Bloquear hasta que finalice la selección

      this._locked = true;

       

       

      //Show as a centered modal dialog

      PopUpManager.addPopUp(dialogo, this.parentDocument as DisplayObject, true);

      PopUpManager.centerPopUp(dialogo);

       

      When I close the pop-up I return the focus to the original component (to mantain the focus loop order). I can see the focus draw in the original component, the problem is that when I press the Tab key, the focus doesn't select the next component in the focus chain, but if I click in any part of the screen and then I press the Tab key it works properly.

       

      Any suggestions?

        • 1. Re: FocusManager problem when closing a Pop-up
          miguel8312 Level 3

          perhaps you can reset focus. Listen to the button clicked of the PopUpManager.centerPopUp(dialogo);  and then after it gets clicked then you can reset focus to the component you want.

          like

          comp.setFocus

          This sounds logical to me.

          let me know.

          Miguel

          • 2. Re: FocusManager problem when closing a Pop-up
            Porratic Level 1

            The problem stills there. I've tried using Timers, setting the focus before closing the popup (as you suggested above),... no matter what I done, the only thing that makes the Forms works correctly is clicking in the browser before pressing the tab key.

             

            ¿Could it be a bug in the FLEX 4.5 framework?, when the component and the application was MX all worked perfectly!!!.

             

            Thanks.

            • 3. Re: FocusManager problem when closing a Pop-up
              Flex harUI Adobe Employee

              That shouldn't have been necessary.  The FM should activate and deactivate

              automatically.

               

              Did you force-link PopUpManager into the main app?

              • 4. Re: FocusManager problem when closing a Pop-up
                Porratic Level 1

                I will detail my explanation:

                 

                1.- I'm loading a section of the application using an SPARK Module and a ModuleLoader.

                2.- Inside the Module I'm using a custom component that inherits from a SPARK TextInput. It has a custom skin.

                3.- When that custom component receives the focus I call the PopUpManager to display a centered modal dialog.

                4.- When the dialog is closed the focus is not returning to the TextInput so I must use the focusManager instance to get the TextInput getting the focus (the FOCUS_IN event is fired).

                5.- I can see the focus drawed over the custom TextInput, but when I press the Tab key the focus go from tabIndex=1 to tabIndex=106 (assigned to a component in the parent module).

                 

                It's like the focusManager is not detecting correctly the nextTabIndex in the chain.

                 

                What do you mean about forcing PopUpManager into the main application?.

                 

                Thanks.