I have a custom combo box (derived from comboBox with
addition of an extra mehtod for searching) and I am using it as the
itemRender of a DataGridColumn. Combo box has a data provider of
(or source of) an ArrayCollection.
When I click on a button or change the combo box I'd like to
find out what is the selected item? How do I point to the selected
Here is part of the code if required, greately appreciate
your help or any hints/tips.
You don't. When working with data-driven controls, you never
directly access the items in the display, but rather you work
through the dataProvider. This is because Flex/Flash re-uses the
visual components when the list is scrolled. So only the elements,
say the combo boxes, that are currently visible actually exist.
This means any itemRenderer that is interactive must update
the dataProvider when the user updates the control state.
Thanks a lot for your reply, the hint was very helpful.
The resultant working code certainly looks simple, but it
took couple of hours to get there. (it thought it was odd that the
object passed as a parameter to set of combobox was the whole
selectedItem of grid!)
In anycase, if anyone else has the same problem, all I had to
do was to implement accessors method for data (set and get) and
write a function that handles change event.