Working on a component which needs to programatically set focus to a TextInput field and make sure that the cursor is placed at the end of current value. I found this possible by using both the Flex FocusManager and also the setSelection() method of TextInput. Figured the code snippit might be useful to other people so here it is.
//assuming myInputField is the id of a TextInput field
focusManager.setFocus(myInputField);
myInputField.setSelection(myInputField.length, myInputField.length);
Thanx, man. It helped me... :)
ReplyDelete