An example of such on my blog From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Hoff Sent: Monday, November 03, 2008 2:08 PM To: [email protected] Subject: [flexcoders] Re: adding (none) option to comboboxes
Hi Derrick, The ComboBox prompt will not solve your problem here. It only appears when the selectedIndex==-1; Unless you want to subclass ComboBox, you're going to have to add "none" to the dataProvider, and implement custom logic to account for it. Since you're using the same dataProvider elsewhere, I suggest that you use the object utility copy function, to make a deep copy of the collection; to be used for the ComboBox with "none" added. -TH --- In [email protected]<mailto:flexcoders%40yahoogroups.com>, "Derrick Anderson" <[EMAIL PROTECTED]> wrote: > > nevermind, i discovered the 'prompt' property :) > > On Mon, Nov 3, 2008 at 3:04 PM, Derrick Anderson < > [EMAIL PROTECTED] wrote: > > > hi, i know this is probably a simple question- but what's the best way of > > adding a (none) label to a combobox. i have a setter for the dataprovider > > where I add an option for (None) in the list, but I don't actually want it > > in the dataprovider if that makes sense. Basically, I want (None) to always > > be a selectable item in comboboxes, but I don't actually want to put that > > option in the arraycollection combobox dataprovider. here is the setter for > > the combobox dataprovider > > > > public function set segmentList(list:ArrayCollection):void > > { > > _segmentList = list; > > var item:DataSegmentVO = new DataSegmentVO(); > > item.dataSegmentID = 0; > > item.dataSegmentName = '(None)'; > > > > if(_segmentList[0].dataSegmentID != 0) > > _segmentList.addItemAt(item,0); > > > > > > dispatchEvent(new Event("segmentsChanged")); > > } > > > > the problem is that same segmentList arraycollection is used in the place I > > manage segments, and it puts a (none) option in there and it doesn't make > > sense there. > > > > thanks, > > derrick anderson > > >

