No, and in fact when I query signalList.length, it returns the correct number.  
Furthermore, 
if I later create another component and set the signalList in it for it's 
combobox, it will 
display correctly without the blank first element...






--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Does signalList have an extra element in it?
> 
>  
> 
> Tracy
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of netdeep
> Sent: Friday, July 11, 2008 11:46 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: combobox fills in with blank element
> 
>  
> 
> 
> Here is the relevant code from the component with the combobox:
> 
> [Bindable]
> private var signalList:ArrayCollection = new ArrayCollection();
> 
> public function setSignals(sig:ArrayCollection):void {
> signalList = sig;
> }
> 
> <mx:ComboBox dataProvider="{signalList}" selectedIndex="0" 
> toolTip="{signal.selectedItem.name}" change="selectSignal()"
> color="#000000" id="signal" labelField="name"/>
> 
> And here is my Application actionscript code for populating signalList:
> 
> var arr:Array = archiveList.selectedItems;
> for (var i:int=0; i<arr.length; i++) {
> if (!signalList.contains(arr[i].name)) {
> signalList.addItem(arr[i].name);
> }
> }
> var sort:Sort = new Sort();
> 
> // Set the sort field (case-insensitive)
> sort.fields = [new SortField(null,true)];
> // Assign the Sort object to the view.
> signalList.sort = sort;
> // Apply the sort to the collection.
> signalList.refresh();
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > Show your code. Last time, someone was inadvertently putting a space
> > into the CB's dataProvider
> > 
> > 
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of netdeep
> > Sent: Friday, July 11, 2008 5:48 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] combobox fills in with blank element
> > 
> > 
> > 
> > I have an ArrayCollection which is the dataProvider for a combobox in
> a
> > custom component. 
> > However the ArrayCollection is located in the application so I assign
> it
> > to the custom 
> > component via actionscript in the component. 
> > 
> > When I call addItem on the ArrayCollection the items go into the
> > combobox, however the 
> > first element is always blank. How can I can get rid of this and get
> the
> > combobox to add only 
> > the items I am adding to the ArrayCollection?
> >
>



Reply via email to