how to set flex combobox cursor position

Posted by crazy horse on Stack Overflow See other posts from Stack Overflow or by crazy horse
Published on 2010-03-17T21:39:40Z Indexed on 2010/03/17 22:11 UTC
Read the original article Hit count: 528

Filed under:
|
|

I have a combobox implementation as follows - Based on user input (min 2 chars) in the editable combobox, the data provider is refreshed and drop-down opened, showing different data sets as user input varies.

Problem is that after drop-down opens, the cursor moves back to the beginning. So for instance, the user types in "ab", and wants to type in "c" to form the search string "abc". Due to the cursor re-setting its position to 0, the search string instead ends up as "cab".

Here's what I tried already (doesn't work) : textInput.mx_internal::getTextField().setSelection(index, index);

where index = length of user input. This selects text from index to index (which effectively un-selects text) and is supposed to place the cursor at the end.

Any thoughts?

© Stack Overflow or respective owner

Related posts about flex

Related posts about combobox