<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Creating a view cursor on an ArrayCollection in Flex</title>
	<link>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Thu, 08 Jan 2009 12:05:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Ponle</title>
		<link>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/#comment-17330</link>
		<author>Ponle</author>
		<pubDate>Fri, 12 Dec 2008 06:20:43 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/#comment-17330</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-12664</link>
		<author>ev01</author>
		<pubDate>Tue, 13 May 2008 18:36:39 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/#comment-12664</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="code"&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-12663</link>
		<author>ev01</author>
		<pubDate>Tue, 13 May 2008 18:08:12 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/#comment-12663</guid>
		<description>I am trying to do something similar only with an ArrayCollection that is setup like this:
&lt;pre class="code"&gt;
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}]);
&lt;/pre&gt;

So then I made a simple test function:

&lt;pre class="code"&gt;
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);
}
&lt;/pre&gt;

Every time it throw this error:

"Error: Find criteria must contain at least one sort field value."


Why wouldn'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>
