7 Replies Latest reply on Oct 25, 2010 9:02 AM by Flex harUI

    Manually dispatching a keyboard tab event on a form does not work

    lillychan1

      Hi,

       

      I am trying to solve the following issue:

      I have a form that is sitting on a TitleWindow. This is a popup window. I have a TextInput field. After clicking on the TextInput field when I try to paste something on it, nothing happens the first time and it works i.e. I am able to paste when I do a cntrl V the second time (I am trying to solve this weired behavior). When I use the keyboard to tab to the TextInput field I am able to paste using cntrl V  the first time itself.

       

      Therefore, I am trying to manually dispatch a tab keyboard event on a form using the following code and this does not work. I have 2 TextInput component on the form and I want the cursor to be on the second TextInput component.

      I have a have a key down handler and I can see that the event that comes in is a tab event, but on the UI the cursor does not position itself correctly.

       

      myForm.setFocus();

      myForm.dispatchEvent(

       

      new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, Keyboard.TAB,Keyboard.TAB ))

       

      Am I missing something?

       

       

      Appreciate your help.

       

      Thanks

       

      Lilly