PopUp - select by keypress

Help
Neon
2005-11-06
2012-07-13
  • Neon
    Neon
    2005-11-06

    I would like to extend either PopUpList or PopUpMenu, to make it so each item in the list is indexed by a letter or number. Pressing the appropriate key selects the item. For example:

    Menu


    1. Option 1
    2. Option 2.
    3. Option 3.

    The user would be able to press the "3" key to jump to "Option 3". My first attempt was to extend PopUpList, overriding the handleInput method, to implement this functionality. Unfortunately I quickly learned that while PopUpList has a getSelectedIndex() method, there is no "set" counterpart. I need a way to select a particular item programmatically. Does anyone have any ideas on the best way to accomplish my goal?

    Thanks,
    Neon