I'd lost track that we were in a renderer.
But even in a renderer, correct me if I am wrong, a Combo box can only set its selectedItem under two conditions, one being the dataProvider items are primitive values, the second being the item assigned is a reference to the item in the combo's dataProvider. Neither is the case here, so we couldn't expect the combo to set itself correctly. Whatever, we need to see some code. Tracy Spratt, Lariat Services, development services available _____ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Alex Harui Sent: Wednesday, March 11, 2009 12:28 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: comboBox in datagrid I think we need to see some code, like how the renderer is set up. A combobox in a datagrid is a renderer so its data setter will fire setting the selectedItem to the item's dataField assigned to its column. The question is why itemToLabel and the labelFunction didn't do its thing. Alex Harui Flex SDK Developer Adobe Systems Inc. <http://www.adobe.com/> Blog: http://blogs. <http://blogs.adobe.com/aharui> adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Tuesday, March 10, 2009 7:27 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: comboBox in datagrid No, you shouldn't have to do anything like that. Normal behavior for a combo box is to display nothing until a user interacts with it, selectedItem is null and selectedindex is -1. If yours is doing something else then there is code doing it. Is it a stock ComboBox? It sounds like someone has overridden the internal text field. Or ha, there is a prompt specified that is a code value. Tracy Spratt, Lariat Services, development services available _____ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Libby Sent: Tuesday, March 10, 2009 6:11 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: comboBox in datagrid I wish...no, I'm using labelField in one and a labelFunction in another one, but these are not invoked until you actually click on the dropdown. Thus, when data is first retrieved into the dropdown, the darned thing is displaying the "data" field rather than the "label: field. Should I be firing off something to force the dropdown to update when the data comes in? --- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com, "Tracy Spratt" <tspr...@...> wrote: > > You probably need to specify the labelField. > > > > Tracy Spratt, > > Lariat Services, development services available > > _____ > > From: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com [mailto:flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com] On > Behalf Of Libby > Sent: Tuesday, March 10, 2009 4:24 PM > To: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com > Subject: [flexcoders] Re: comboBox in datagrid > > > > no, I 'm saying my comboBox displays whats in its data part of its array > collection, not its label, when it receives a new batch of data. Your > checkbox appears to do the same thing. > > --- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com, > "Anthony DeBonis" <anthony@> wrote: > > > > Are you talking about an example like this? > > You may be better off creating a reusable/testable component in separate > AS or MXML file. > > > > <mx:Component> > > <mx:CheckBox creationComplete="init()"> > > <mx:Script> > > <![CDATA[ > > > > private var _data:Object; private function init():void { > this.addEventListener(MouseEvent.CLICK, update); > > } override public function get data():Object { > > return _data; > > } > > > > [Bindable] > > override public function set data(o:Object):void { > > _data = o; > > if(_data.checked == "true") this.selected = true; > > else this.selected = false; > > } > > > > private function update(event:MouseEvent):void { > > if(this.selected) _data.checked = "true"; > > else _data.checked = "false"; > > } > > > > > > ]]> > > </mx:Script> > > </mx:CheckBox> > > </mx:Component> > > >