4 Replies Latest reply: Aug 3, 2012 6:47 AM by RiaanP RSS

    Tabindex in forms on mobile?


      Is it possible to enable/use the tab function of the softkeyboard?

      Just setting the tabindex on inputfields won't do the job unfortunately.

        • 1. Re: Tabindex in forms on mobile?
          Brian Vaughn Community Member

          Don't suppose you ever found the answer to this question?


          I'm wondering the same thing. Simply defining tabIndex doesn't seem to work. The "Next" button on a mobile device's onscreen keyboard doesn't do anything.

          • 2. Re: Tabindex in forms on mobile?

            I'll second Brian's question. THought it would have been as simple as that too.. but alas it isn't.


            Come to think of it, it actually makes sense that it doesn't work. I'd imagine you'd have to somehow let AIR know to tell iOs how many textifleds there are.. iOs in return will dispatch events to AIR who will then let Flash know that the Next or Previous button has been clicked...


            I'll dig around some more to see if I can find an aswer and will post back here if I'm in luck.

            • 3. Re: Tabindex in forms on mobile?
              Brian Vaughn Community Member

              Hey RiaanP,


              I've had a little luck in this area, but it's nothing to get too excited over. Here's what I've done:

              1. Set tabEnabled & tabChildren to FALSE for my parent display object
              2. Add a KeyboardEvent.KEY_UP event listener to that same component
              3. In my event handler, check to see if event.keyCode == Keyboard.TAB || event.keyCode == 16777230 (16777230 is the Nook's "next" key's code)
              4. Ask FocusManager which component is currently focused (via getFocus())
              5. Manually call .setFocus() on the next item that should be focused


              This is obviously a little dirty but it's worked...okay...for me, for now. I hope you're able to find a better solution. If you do, please share it back here!



              • 4. Re: Tabindex in forms on mobile?
                RiaanP Community Member

                This seems like a good post that covers a lot of what is possible with the keyboard for both Android and iOs.

                http://devgirl.org/2011/11/29/flex-mobile-development-flex-4-6-cool-new-soft-keyboard-feat ures-sample-w-source/


                It doesn't look like the native Next and Previous buttons work though. You may be able to coax the Return key into being the Tab key though!