No, the data property is just for convenience.  The selectedItem
property returns a reference to the entire dataProvider item.

 

Just do:

var sCategory:String = XML(myCombo.selectedItem)[EMAIL PROTECTED]; //The XML() 
is
needed for binding expressions but probably not here.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of dnk
Sent: Tuesday, September 16, 2008 7:02 PM
To: Flexcoder List
Subject: [flexcoders] Simple question - custom labels and data fields in
ComboBox

 


Hi there.. I have been googling on this one... I have a ComboBox that
has an ArrayCollection for a dataSource.

Now my ArrayCollection is from a MySQL query.... Now since the ComboBox
control expects the data to have a label field and a data field - it is
obviously seeing my result as [Object], [Object].

Now I know I can change the label field using:

labelField="@category"

Now how can I do the same for the data field?

My database is passing back one called "category" (using that for the
label), and one called "id" (using that one for the data).

Do I have to somehow write a function to convert the "id" to "data"?

DNK 

 

Reply via email to