<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating a view cursor on an ArrayCollection in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Fri, 19 Mar 2010 20:35:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: moe</title>
		<link>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/comment-page-1/#comment-7158</link>
		<dc:creator>moe</dc:creator>
		<pubDate>Thu, 04 Mar 2010 01:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/#comment-7158</guid>
		<description>Hi...
Thanks for this tutorial, but i wanna know if this code can be used to be data provider for datagrid?
how to find data in datagrid if datagrid has sorted by clicking the header, and arraycollection is not sorted like datagrid did.</description>
		<content:encoded><![CDATA[<p>Hi&#8230;<br />
Thanks for this tutorial, but i wanna know if this code can be used to be data provider for datagrid?<br />
how to find data in datagrid if datagrid has sorted by clicking the header, and arraycollection is not sorted like datagrid did.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ponle</title>
		<link>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/comment-page-1/#comment-3113</link>
		<dc:creator>Ponle</dc:creator>
		<pubDate>Fri, 12 Dec 2008 06:20:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/#comment-3113</guid>
		<description>Thanks so much for his post,it was magical</description>
		<content:encoded><![CDATA[<p>Thanks so much for his post,it was magical</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ev01</title>
		<link>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/comment-page-1/#comment-3112</link>
		<dc:creator>ev01</dc:creator>
		<pubDate>Tue, 13 May 2008 18:36:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/#comment-3112</guid>
		<description>Ok, The answer is on the cursor.findAny line you need to specify the field name. Using the example above:
&lt;pre class=&quot;code&quot;&gt;
var found:Boolean = cursor2.findAny({Territory: ”Arizona”});
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Ok, The answer is on the cursor.findAny line you need to specify the field name. Using the example above:</p>
<pre class="code">
var found:Boolean = cursor2.findAny({Territory: ”Arizona”});
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: ev01</title>
		<link>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/comment-page-1/#comment-3111</link>
		<dc:creator>ev01</dc:creator>
		<pubDate>Tue, 13 May 2008 18:08:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/#comment-3111</guid>
		<description>I am trying to do something similar only with an ArrayCollection that is setup like this:
&lt;pre class=&quot;code&quot;&gt;
new ArrayCollection([{Region:&quot;Southwest&quot;, Territory:&quot;Arizona&quot;,Territory_Rep:&quot;Barbara Jennings&quot;, Actual:38865, Estimate:40000}, {Region:&quot;Southwest&quot;, Territory:&quot;Arizona&quot;, Territory_Rep:&quot;Dana Binn&quot;, Actual:29885, Estimate:30000}]);
&lt;/pre&gt;

So then I made a simple test function:

&lt;pre class=&quot;code&quot;&gt;
private function testDpfind():void {
	var sortField2:SortField = new SortField(&quot;Territory&quot;, true);
            var sort2:Sort = new Sort();
            sort2.fields = [sortField2];
            dpFlat.sort = sort2;
            dpFlat.refresh();
            var cursor2:IViewCursor;
            cursor2 = dpFlat.createCursor();
	var found:Boolean = cursor2.findAny(&quot;Arizona&quot;);
	mx.controls.Alert.show(&quot;Hey&quot;,&quot;&quot;+found);
}
&lt;/pre&gt;

Every time it throw this error:

&quot;Error: Find criteria must contain at least one sort field value.&quot;


Why wouldn&#039;t this work?</description>
		<content:encoded><![CDATA[<p>I am trying to do something similar only with an ArrayCollection that is setup like this:</p>
<pre class="code">
new ArrayCollection([{Region:"Southwest", Territory:"Arizona",Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000}, {Region:"Southwest", Territory:"Arizona", Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}]);
</pre>
<p>So then I made a simple test function:</p>
<pre class="code">
private function testDpfind():void {
	var sortField2:SortField = new SortField("Territory", true);
            var sort2:Sort = new Sort();
            sort2.fields = [sortField2];
            dpFlat.sort = sort2;
            dpFlat.refresh();
            var cursor2:IViewCursor;
            cursor2 = dpFlat.createCursor();
	var found:Boolean = cursor2.findAny("Arizona");
	mx.controls.Alert.show("Hey",""+found);
}
</pre>
<p>Every time it throw this error:</p>
<p>&#8220;Error: Find criteria must contain at least one sort field value.&#8221;</p>
<p>Why wouldn&#8217;t this work?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
