is it possible in Flex to add a value (id) to each individual
row (item) within a comboBox?
For example my comboBox is being populated from a DB table
through a web service. The table consists of an ID field and the
name field, and is relational to the rest of the database - so I
want to display the name in the comboBox, but actually pass the ID
I am currently using the "labelFeild" to display the relevant
column in the comboBox which works, but I additionally want to pass
the ID across and through a function etc.....
This is not a Flex Builder question. Next time post in the
The data provider for the combobox can be an object
containing absolutely anything you want. In you case the
dataProvider will probably be an array of objects, each item object
with the properties id, and name.
You use labelField to tell the combo which to display.
When an item is selected, you can access any property of the
var sIdSelected:String = myCombobox.selectedItem.id