The difference is that addItemAt() is a method of the List class (inherited from ScrollSelectList), which is how you called it. It is documented here as part of List:
 
 http://livedocs.macromedia.com/flex/15/asdocs_en/mx/controls/List.html
 
The addItemsAt() method is on the DataProvider class.
 
Stephen


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Clint Modien
Sent: Wednesday, June 29, 2005 11:49 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: ComboBox 'Please Select' first Item

You right... it appears there's have some conflicting documentation on the DataProvider API
the one I looked at here didn't have your method...
http://livedocs.macromedia.com/flex/15/asdocs_en/mx/controls/listclasses/DataProvider.html

but this documentation does...
http://livedocs.macromedia.com/flex/15/flex_docs_en/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flex_Documentation&file=00000210.htm


On 6/29/05, digital_eyezed <[EMAIL PROTECTED]> wrote:

Thanks,

Added this and it worked:

function addSelect(event){
                         var theTargetId = event.target;
                         theTargetId.addItemAt(0,"Please Select",0);
                         theTargetId.selectedIndex = 0;
}

Small typo in yours, its addItemAt not addItemsAt, took me a wee
while to notice it.

Best Regards,

Iain



--- In flexcoders@yahoogroups.com, Clint Modien <[EMAIL PROTECTED]> wrote:
> Should be
>
> function addSelect(event){
> var theTarget = event.target <http://event.target.id/ >;
> theTarget.addItemsAt(0,new Array([{label:"Please Select",data:0}]);
> }
>
> Or the easiest way would be to add the Item to the result when you
get it
> back
>
> event.result.push({label:"Please Select", data:0});
>
> the "label" and "data" properties of the object should coincide
with the
> properties of your VO
>
> if you can give me the definition of the VO maybe I can elaborate
>
> On 6/29/05, digital_eyezed <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > How do I have the first item in the combobox read 'please select'
> > with a corrosponding data value of 0(zero). The rest of the
combobox
> > should be filled with a return from a remote object call and the
> > resulting VO objects (with label / Data pairs).
> >
> > I can fill the comboBox with the VO's no problem, but How do I
add
> > the 'Please Select'?
> >
> > I have tried this function on the creationComplete event of the
> > Combobox:
> >
> > function addSelect(event){
> > var theTargetId = event.target.id <http://event.target.id>;
> > theTargetId.addItemAt(0,"Please Select",0);
> > }
> >
> > any help most appreciated.
> >
> > Regards,
> >
> > Iain
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to