6 Replies Latest reply on Apr 15, 2010 9:32 AM by Flex harUI

    Tabbing

    JockMahon Level 1

      I have controls that are in a

      title window, iv set the tab indexs for the components

      but when i tab the focus ring goes around the entire title window , whats going on?

        • 1. Re: Tabbing
          Flex harUI Adobe Employee

          Show some code.  What is the parent of the TW?  How did it get parented?

          1 person found this helpful
          • 2. Re: Tabbing
            JockMahon Level 1

            As a quick example here is a app and a titleWindow popup, when i press tab with the window open the focus goes to the address bar in the browser

             

            <?xml version="1.0" encoding="utf-8"?>
            <s:Application name="Spark_DropDownList_layout_requestedRowCount_test"
                           xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx">

             

                <fx:Script>
                    <![CDATA[
                        import mx.managers.PopUpManager;
                       
                        import spark.components.TitleWindow;
                       
                        private var popupWindow:testForm
                        protected function button1_clickHandler(event:MouseEvent):void
                        {
                            popupWindow = PopUpManager.createPopUp(this,testForm,true) as testForm;
                            popupWindow.addEventListener("close"  , closeWindow );
                        }
                       
                       
                        private function closeWindow(e:Event):void
                        {

             

                            PopUpManager.removePopUp( popupWindow );
                        }
                       
                       
                    ]]>
                </fx:Script>
               
                <s:Button click="button1_clickHandler(event)" label="open popup"/>
            </s:Application>

             

            ...

             

             

            <?xml version="1.0" encoding="utf-8"?>
            <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"
                     creationComplete="group1_creationCompleteHandler(event)">
                <fx:Script>
                    <![CDATA[
                        import mx.events.FlexEvent;

             

                        protected function group1_creationCompleteHandler(event:FlexEvent):void
                        {
                            a1.tabIndex = 1;
                            a2.tabIndex = 2;
                            a3.tabIndex = 3;
                        }

             


                        protected function button1_clickHandler(event:MouseEvent):void
                        {
                            var eventObject:Event = new Event("close");
                            dispatchEvent(eventObject);
                        }

             

                    ]]>
                </fx:Script>
                <fx:Declarations>
                    <!-- Place non-visual elements (e.g., services, value objects) here -->
                </fx:Declarations>
                <mx:Form x="10" y="10">
                    <mx:FormItem label="Label" id="a1">
                        <s:TextInput/>
                    </mx:FormItem>
                    <mx:FormItem label="Label" id="a2">
                        <s:TextInput/>
                    </mx:FormItem>
                    <mx:FormItem label="Label" id="a3">
                        <s:TextInput/>
                    </mx:FormItem>
                </mx:Form>
               
               
                <s:Button click="button1_clickHandler(event)"/>
            </s:TitleWindow>

            • 3. Re: Tabbing
              Flex harUI Adobe Employee

              All browsers or a specific browser?  There have been lots of problems with

              FireFox 3.6

              1 person found this helpful
              • 4. Re: Tabbing
                JockMahon Level 1

                so far just ie 7


                • 5. Re: Tabbing
                  JockMahon Level 1

                  it would seam that this problem is related to

                   

                  implements="mx.managers.IFocusManagerComponent"

                   

                  in the titleWindow root tag when i take this out the tabbing works correctly

                   

                   

                  What is the best way to listener for key down event, currently i have be implementing this interface and overridding the keyUpHandler

                   

                  so

                   

                              override protected function keyUpHandler(event:KeyboardEvent):void
                              {
                                  super.keyUpHandler(event);
                                
                                  if( event.keyCode == 27 ) //ESC
                                  {
                                      formCloseButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false));
                                      return;
                                  }

                                      ...

                   

                   

                  this was working for me  well as i meant i didn't have to worry about killing listeners when windows opened/closed

                  • 6. Re: Tabbing
                    Flex harUI Adobe Employee

                    Key events bubble so you don't need to have focus as long as one of your

                    children has focus.