In Flex 4/Spark, the dataProvider contract is limited to IList implementations (the Flex framework provides several IList implementations straight out of the box like ArrayCollection, ArrayList, XMLListCollection, XMLList, etc). We decided to do this to reduce complexity which in our dataProvider-aware controls. As part of this, we now don't auto-wrap raw data like Array or XML into ArrayCollections or XMLListCollections, which is why you need to do that manually.
Cheers, Deepa Subramaniam Flex SDK Engineer From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of dorkie dork from dorktown Sent: Friday, October 23, 2009 3:26 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Does DataGroup support XML? For future reference XMLList needs to be wrapped in XMLListCollection: <!-- An item renderer function can be defined in order to display a mix of data and graphical items. --> <s:DataGroup itemRenderer="CommentItemRenderer" x="10" y="140" width="100%" dataProvider="{new XMLListCollection(XML(content1.lastResult).posts.post)}" > <s:layout> <s:VerticalLayout gap="10"/> </s:layout> </s:DataGroup> On Fri, Oct 23, 2009 at 1:07 PM, dorkie dork from dorktown <dorkiedorkfromdorkt...@gmail.com<mailto:dorkiedorkfromdorktown%40gmail.com>> wrote: > I am converting my Repeater code to DataGroup code and it doesn't > appear to support XML in the dataProvider. Does it support XML or is > it something I'm doing? Here is the error message: > > TypeError: Error #1034: Type Coercion failed: cannot convert > xmll...@505bb7e9 to mx.collections.IList. > > Here is the code: > <!-- An item renderer function can be defined in order to display a > mix of data and graphical items. --> > <s:DataGroup itemRenderer="CommentItemRenderer" x="10" y="140" > dataProvider="{XML(content1.lastResult).posts.post}" > > <s:layout> > <s:VerticalLayout/> > </s:layout> > </s:DataGroup> > > Thanks >