My best suggestion is provide u r data provider as a arraycollection wih certain labels in side the array object
something like displayName , databaseName var arrayCollection:ArrayColection=new ArrayColection(); arrayCollection.addItem([displayName:"YES",databaseName :"Y"] arrayCollection.addItem([displayName:"NO",databaseName :"N"] And give the labelfeild as displayName for combobox and when user clicks the combobox if at all u want the selected item u can get by comboxid.seletectedit...@databasename it will fetch you Y or N and but it will display Yes or NO foir diplay purpose Best Regards Venu Gopal V On Tue, Feb 23, 2010 at 2:44 AM, Ars <mdar...@gmail.com> wrote: > Hello Experts, > > I have following piece of code from main mxml and below that I have > component code for Combobox. Please let me know what is wrong in my > code. It wipe the value once I select values from combo box. I am > using label function to decode values as Yes/No when populating Data > Grid from the database. Also I will appreciate if I get a standard way > to display Yes/No list to display and store values(Y/N) in database. > My code is based on various examples given on this topic. Sorry if I > have made the Code-cocktail. > > Thanks a lot. > Arshad > > main.mxml > --------------------- > [Bindable] private var queryData:ArrayCollection = new > ArrayCollection(); > ------ > ------ > <mx:DataGrid id="dgGrid" width="644" dataProvider="{queryData}" > height="270" editable="true" > > ------ > ----- > <mx:DataGridColumn width="175" textAlign="center" > headerText="Tax" > sortable="false" > dataField="tax" > labelFunction="taxLabel" > editable="true" > editorDataField="value" > itemEditor="yesNoComboBox"> > </mx:DataGridColumn> > > ---------------------------------Item Render yesNoComboBox ---------- > <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" > > > implements="mx.controls.listClasses.IDropInListItemRenderer,mx.managers.IFocusManagerComponent"> > > <mx:Script> > <![CDATA[ > import flash.events.Event; > import mx.controls.DataGrid; > > private var _listData:DataGridListData; > // Define a property for returning the new value to the > cell. > [Bindable] > public var value:Object ; > > // Implement the drawFocus() method for the VBox. > override public function drawFocus(draw:Boolean):void { > cbo.setFocus(); > } > > override public function get data():Object { > return super.data; > } > > /* override public function set data(value:Object):void { > cbo.data=value[_listData.dataField]; > } */ > > override public function set data(value:Object):void > { > if(value != null) > { > super.data = value; > // set itemRenderer’s state based on > data value > cbo.selectedItem = value; > } > } > public function get listData():BaseListData > { > return _listData; > } > > public function set listData(value:BaseListData):void > { > _listData = DataGridListData(value); > } > > public function changeHandler(event:Event):void > { > trace(String(cbo.selectedItem)) > data.selected=String(cbo.selectedItem); > > IList(DataGrid(owner).dataProvider).itemUpdated(cbo.selectedItem); > } > > > ]]> > </mx:Script> > <mx:Binding destination="value" source="cbo.value"/> > > <mx:ComboBox id="cbo" editable="true" width="100%" > dataChange="changeHandler(event)" > creationComplete="cbo.selectedItem = data.selected" > > <mx:dataProvider> > <mx:String>Yes</mx:String> > <mx:String>No</mx:String> > </mx:dataProvider> > </mx:ComboBox> > </mx:VBox> > > -- > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to flex_in...@googlegroups.com. > To unsubscribe from this group, send email to > flex_india+unsubscr...@googlegroups.com<flex_india%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/flex_india?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to flex_in...@googlegroups.com. To unsubscribe from this group, send email to flex_india+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.