This content has been marked as final. Show 5 replies
Are you using a data provider to bind the list values?
If you are (and I recommend it) then you should just manipulate the data provider itself, rather than the controls.
Have you got some example code?
I do have the listbox bound to a data provider and changing values works, etc which is as expected. In this particular case, I have an "Add" button that inserts a row into the list. As expected, the custom item renderer is displayed. I then select the newly inserted row. What I'd like to happen is that once I've selected the row, I'd like to set focus to the text input control that is in the custom item renderer. This is where I cannot determine how to reference the control. I've tried variations of the following syntax, all to no avail:
(myList is the list control, selectedIndex is the row number that is highlighted and txtColor is the name of the text input control in the custom item renderer)
Ahh I see, excellent question :)
When you focus on the selected item in the list, I'm assuming it doesn't just focus on the text field? (that would be too easy...)
Do you have an AS class extending TextInput as your item renderer or are you using an inline MXML renderer?
it is a custom component...a horizontal box that contains the 2 controls...textbox and checkbox.
Did that code line -- focusManager.setFocus(myList.selectedIndex.txtColor); -- work?
because I'm trying to get a selected item from my list component and I can't, I have a list that render a data provider data using a complex item renderer and I need to access a checkBox defined in the item renderer, How can I do that?
Can you help-me please?