I suggest using e4x expressions against the XML, and then putting the
result in an XMLListCollection.

var xlResults:XMLList = xmlData.result.(attribute("id") == "1");

trace(xlResults.toXMLString());  //to verify your data

xlcResults = new XMLListCollection(xlResults);

 

You did not say how you got your XML into an ArrayCollection, but I
suspect it is not the good way.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 

________________________________

From: [email protected] [mailto:[email protected]] On
Behalf Of Henrique
Sent: Tuesday, February 10, 2009 2:19 PM
To: [email protected]
Subject: Re: [flexcoders] ArrayCollection DataProvider question.

 

Humm, you have to make a filterFunction, like this:

 

private function filterFucntion(item:Object):Boolean

{

   return item.id == "1";

}

 

Henrique F. Marino

blog.dclick.com.br <http://blog.dclick.com.br> 

www.dclick.com.br <http://www.dclick.com.br> 

On Tue, Feb 10, 2009 at 3:35 PM, sailorsea21 <[email protected]
<mailto:[email protected]> > wrote:

I loaded the following xml as an ArrayCollection. 

<data>
<result id="1">
<date>today</date>
<yes>13154</yes>
<no>654321</no> 
</result>
<result id="1">
<date>yesterday</date>
<yes>21354</yes>
<no>5468432</no> 
</result>
<result id="2">
<date>today</date>
<yes>2665</yes>
<no>4256</no> 
</result>
<result id="2">
<date>yesterday</date>
<yes>7425</yes>
<no>7542</no> 
</result>
</data>

How can I use this as a dataprovider but only using the values in 
<result id="1"> and not <result id="2">?

My arraycollection var is "Arraydays".
I tried {Arraydays.(@id=='2')} but it gave me an error: Error #1123: 
Filter operator...

Thanks.

 



Reply via email to