combobox in Flex
Posted
by Adnan
on Stack Overflow
See other posts from Stack Overflow
or by Adnan
Published on 2010-06-17T07:37:11Z
Indexed on
2010/06/17
7:43 UTC
Read the original article
Hit count: 287
I have combo-box;
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" >
<fx:Script>
<![CDATA[
public var cbSelected:String;
]]>
</fx:Script>
<mx:ComboBox id="CustomBox" updateComplete="cbSelected=CustomBox.selectedLabel;" dataProvider="{parentDocument.getAllResult4.lastResult}" labelField="name"/>
</mx:VBox>
And I display the combo-box in a data-grid. My problem is that I need a key to be send back. My table is as below:
KEY | NAME
ON | ONE
TW | TWO
So I display the name in combobox by using
labelField="name"
But how to have the return value of key
? so ONE
is displayed in the combo-box and ON
is returned back.
© Stack Overflow or respective owner