Thanks Manish. I appreciate your logic re the prompt and am keen to do it the model-view architecture way. I just do not know how to handle the result of the CF query As I explained at the beginning of the thread I want to replace my current <mx:ArrayCollection id="cities" source="{mx.utils.ArrayUtil.toArray(ContactService.getCities.result)}" /> approach with one that allows me to do addItem
My attempts to date have ended in failure e.g. public function citiesResultHandler(result:Object) { public var myIList:IList = new ArrayCollection({mx.utils.ArrayUtil.toArray(ContactService.getCities.result)}); // The function to change the collection, and therefore the Array. myIList.addItemAt("All Cities", 0); } Any chance you could point out the errors in the above function --- In flexcoders@yahoogroups.com, Manish Jethani <[EMAIL PROTECTED]> wrote: > > On 11/18/05, yaagcur <[EMAIL PROTECTED]> wrote: > > > Several points of clarification please > > > > 1) OK so as I understand it, in the final version of Flex 2 prompt will > > just be for info and will not be bindable, right? > > If so, is it being replaced by an alternative for easy addition of > > another item? > > Yes, you can call addItem on the ComboBox's data provider. That's the > easiest way. > > > 2) Using the current alphs I can add an item e.g. 'All States' > > However, when I try to add it to a combobox which has been > > populated from a webservice and uses a labelField="STATE" then I get > > the error > > 'Property STATE not found on Object and there is no default value' > > Yes, that's a bug I've seen and fixed. The fix was to make the prompt > property behave like a prompt rather than like a call to addItem. > > > 3) Is it possible to add more than one prompt e.g Western States, > > Eastern States and if so how > > What's the use case? There's only enough space to display one prompt > on the ComboBox. You _could_ have a multiline prompt if you want, but > it's going to be one prompt in the end (not multiple prompts). > > > 4) Would I be better off going back to using a function and ,if so, > > how does the post in my original code need to be amended > > If you want to add an item to the ComboBox, you have to add one to the > data provider. That's the model-view architecture, that's how it > works. > > Manish > ------------------------ Yahoo! Groups Sponsor --------------------~--> 1.2 million kids a year are victims of human trafficking. Stop slavery. http://us.click.yahoo.com/WpTY2A/izNLAA/yQLSAA/nhFolB/TM --------------------------------------------------------------------~-> -- 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/