1 Reply Latest reply on Jun 14, 2006 1:15 AM by jpwrunyan

    cell renderers and tab focus

    jpwrunyan Level 1
      I have a cell renderer for employee data that contains combo boxes and text input. I display this cell renderer in a list component. Although it is possible to tab through components on screen and use the up/down button to move through cell renderers in the List, it is not possible to set focus on any of the components INSIDE the cell renderer using the keyboard. I have to select everthing with the mouse and if I happen to push tab again, the focus moves off the List component entirely. This is very annoying. Is there anything I can do to change this?
        • 1. Re: cell renderers and tab focus
          jpwrunyan Level 1
          By adding the code below I have achieved something close to what I want but with these 3 drawbacks:
          1) though I call setFocus() to move the focus to the desired control, the focus momentarily "jumps" to the first component in the Application! Looks pretty hoaky.
          2) I use a tabIndex that is only updated by keyboard events. if the user clicks on a control with the mouse, unless I implement some very unwieldy logic on each and every tabable control in the cell renderer, I can't integrate mouse focus with keyboard focus (try it to see what I mean).
          3) This is obviously hack code. I don't see that I should have to use Key.addListener() to achieve this. It should be possible withing the UI framework without me going directly to the Key object.

          Anyway, add the following code to any custom cell renderer and you get an uncouth keyboard tab ability. Note: you need to register all your tabable controls in the cell render with an id and then put that id in an array as a string. This is so the line this[tabArray[tabIndex]] will work (ie: this["myCompId"]).