I'm so glad someone is venturing into the world of collections, and I encourage the rest of you to do so :)
A few points that will help you out as you continue to use collections: -You can still pass in a plain old Array as the dataProvider to list-based components. Internally, we wrap that as an ArrayCollection. -The Flex 1.5 IDataProvider interface is now gone. The dataProviders of list-based components are now of type ICollectionView. You need to use the collection-related methods (methods on IList and ICollectionView) to modify and query the data. The ASDocs will be your friends here. Remember, when going through the dataProvider property to modify the underlying data, you will need to cast the dataProvider as IList or ICollectionView depending on which methods you will be calling. -As for what is the difference between ICollectionView and IList - think of IList as a straightforward, simple interface for describing a linear randomly-accessible collection. ICollectionView is more generic then IList and provides broader functionality like sorting, ranging, filtering (not yet in the Alpha), and navigation via an IViewCursor. Happy collections-ing - we're eager for feedback! deepa -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of fowleryj Sent: Tuesday, October 18, 2005 1:01 PM To: [email protected] Subject: [flexcoders] Re: Flex 2.0 - Arrays vs. Collections Thanks - the example made it much clearer. =) --- In [email protected], "Ashish Goyal" <[EMAIL PROTECTED]> wrote: > > I think the doc is pretty explainatory.. To further explain it, You can > still use an Array as dataProvider but any changes in the dataprovider > array won't update the control. If you want your control (DataGrid, List > etc.) to reflect the changes then you need to use Collection (There is > an ArrayCollection). > > Example: > > <m:DataGrid dataProvider="{ArrayDataProvider}"/> // Won't update the > DataGrid if you change element 1 from a to aa. > > <m:DataGrid dataProvider="{ArrayCollectionDataProvider}"/> // Will > update the DataGrid if you change element 1 from a to aa. > > Thanks > -Ashish > > > > > -----Original Message----- > > From: [email protected] > > [mailto:[EMAIL PROTECTED] On Behalf Of fowleryj > > Sent: Tuesday, October 18, 2005 12:10 PM > > To: [email protected] > > Subject: [flexcoders] Flex 2.0 - Arrays vs. Collections > > > > In reference to this page, > > http://livedocs.macromedia.com/labs/1/flex/00001587.html, will > > we now > > have to cast an Array to a Collection before binding to it (using it > > as the dataProvider for a DataGrid, for example)? -- 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 ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/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/

