[flexcoders] Re: Flex 2.0 - Arrays vs. Collections

2005-10-18 Thread fowleryj
Thanks - the example made it much clearer. =)

--- In flexcoders@yahoogroups.com, 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: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED] On Behalf Of fowleryj
  Sent: Tuesday, October 18, 2005 12:10 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Flex 2.0 - Arrays vs. Collections
  
  In reference to this page,
  http://livedocs.macromedia.com/labs/1/flex/1587.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)?





 Yahoo! Groups Sponsor ~-- 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/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/
 






RE: [flexcoders] Re: Flex 2.0 - Arrays vs. Collections

2005-10-18 Thread Deepa Subramaniam
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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of fowleryj
Sent: Tuesday, October 18, 2005 1:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Flex 2.0 - Arrays vs. Collections

Thanks - the example made it much clearer. =)

--- In flexcoders@yahoogroups.com, 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: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED] On Behalf Of fowleryj
  Sent: Tuesday, October 18, 2005 12:10 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Flex 2.0 - Arrays vs. Collections
  
  In reference to this page,
  http://livedocs.macromedia.com/labs/1/flex/1587.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/