<?xml version="1.0" encoding="utf-8"?>

			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Charlie Griefer - Flex for CF&apos;ers</title>
			<link>http://charlie.griefer.com/blog/index.cfm</link>
			<description>ColdFusion developer Charlie Griefer talks and wonders, &quot;is anybody listening?&quot;</description>
			<language>en-us</language>
			<pubDate>Wed, 08 Sep 2010 18:47:29 -0500</pubDate>
			<lastBuildDate>Wed, 23 Apr 2008 14:04:00 -0500</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>charlie@griefer.com</managingEditor>
			<webMaster>charlie@griefer.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>charlie@griefer.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>Charlie Griefer</title>
				<link>http://charlie.griefer.com/blog/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			<item>
				<title>MXML is XML (Duh?)</title>
				<link>http://charlie.griefer.com/blog/index.cfm/2008/4/23/mxml-is-xml-duh</link>
				<description>
				
				&lt;p&gt;Just a quickie today, something that I came across while playing around with Flex.  It could very well be a &quot;duh, Charlie&quot; observation, but i think it bears mentioning.&lt;/p&gt;

&lt;p&gt;Flex makes it very easy to bind elements to other elements or objects.  What this means is that a DataGrid, for example, can be populated by the contents of an ArrayCollection (for CF&apos;ers, think of an ArrayCollection as an array of structures).  The first step is to declare the variable as bindable in your &amp;lt;mx:Script&amp;gt; block:&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
[Bindable]
	private var myArray:ArrayCollection;
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Your DataGrid would then be declared as follows:&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
&amp;lt;mx:DataGrid dataProvider=&quot;{myArray}&quot; id=&quot;myDataGrid&quot;&gt;
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;The curly braces around the value of the dataProvider attribute indicates that it&apos;s a bindable variable.  All pretty straightforward.  But there are other ways to use bind variables to influence the behavior of an element.&lt;/p&gt;  [More]
				</description>
				
				<category>Flex</category>
				
				<category>Flex for CF&apos;ers</category>
				
				<pubDate>Wed, 23 Apr 2008 14:04:00 -0500</pubDate>
				<guid>http://charlie.griefer.com/blog/index.cfm/2008/4/23/mxml-is-xml-duh</guid>
				
				
			</item>
			
			<item>
				<title>Flex: Objects are like Structures. Kinda. (Part II)</title>
				<link>http://charlie.griefer.com/blog/index.cfm/2008/4/18/flex-Objects-are-like-structures-kinda-part-ii</link>
				<description>
				
				&lt;p&gt;Last night I started documenting my journey of learning Flex, focusing on my use of the built-in Object datatype and some issues that I faced in that respect.&lt;/p&gt;

&lt;p&gt;There was one other aspect of this that I meant to touch on.  To recap, I was passing a single Object to a ColdFusion CFC method.  In my little ColdFusion brain, I thought of this as being not unlike a structure.  So, I expected the method to receive a single argument much like a struct with multiple keys.&lt;/p&gt;

&lt;p&gt;Let&apos;s say my ActionScript function looked like this:&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
var args:Object = new Object();
args.stateCode = &quot;CA&quot;;
args.zipCode = &quot;94583&quot;;
args.territory = 3;

// call the remote object method
ro_Customers.getFilteredCustomers(args);
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;I created an Object, populated it with 3 variables (keys), and passed it as an argument to the getFilteredCustomers() method in my remote object (CFC).  Originally, my CFC looked like this:&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;brush: cf&quot;&gt;
&amp;lt;cffunction name=&quot;getFilteredCustomers&quot; returntype=&quot;query&quot; access=&quot;remote&quot;&gt;
	&amp;lt;cfargument name=&quot;filterCriteria&quot; type=&quot;struct&quot; required=&quot;true&quot; /&gt;
	...
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;I assumed that my args Object would be able to be referenced as a structure in the CFC.  It&apos;s a single variable with key/value pairs just like a struct.  But when i tried to reference #arguments.filterCriteria.stateCode#, I found that the variable didn&apos;t exist.&lt;/p&gt;

&lt;p&gt;What actually happens is that the CFC treats each value in the Object as its own argument.  Think &lt;a href=&quot;http://www.talkingtree.com/blog/index.cfm/2005/7/12/ArgCollection&quot; class=&quot;externalLink&quot;&gt;argumentCollection&lt;/a&gt; instead of struct.&lt;/p&gt;

&lt;p&gt;The correct code for the CFC&apos;s arguments is:&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;brush: cf&quot;&gt;
&amp;lt;cffunction name=&quot;getFilteredCustomers&quot; returntype=&quot;query&quot; access=&quot;remote&quot;&gt;
	&amp;lt;cfargument name=&quot;stateCode&quot; type=&quot;string&quot; required=&quot;false&quot; /&gt;
	&amp;lt;cfargument name=&quot;zipCode&quot; type=&quot;string&quot; required=&quot;false&quot; /&gt;
	&amp;lt;cfargument name=&quot;territory&quot; type=&quot;number&quot; required=&quot;false&quot; /&gt;
	...
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Aside from explicitly declaring each value in the Object, I set the &quot;required&quot; attribute to false because in this case, not all of the values may be present in the Object.  A user might choose to search only on stateCode, or only on zipCode, etc.&lt;/p&gt; 
				</description>
				
				<category>ColdFusion</category>
				
				<category>Flex</category>
				
				<category>Flex for CF&apos;ers</category>
				
				<pubDate>Fri, 18 Apr 2008 11:34:00 -0500</pubDate>
				<guid>http://charlie.griefer.com/blog/index.cfm/2008/4/18/flex-Objects-are-like-structures-kinda-part-ii</guid>
				
				
			</item>
			
			<item>
				<title>Flex: Objects are Like Structures.  Kinda.</title>
				<link>http://charlie.griefer.com/blog/index.cfm/2008/4/17/flex-Objects-are-like-structures</link>
				<description>
				
				&lt;p&gt;Over the past few months I&apos;ve been lucky enough to have the opportunity to start playing around with Flex at work.  Overall it&apos;s been a pretty good experience.  I think Flex itself is a very cool technology, and FlexBuilder absolutely ROCKS as an IDE.  Of course, there have been hurdles.  Some I was able to overcome pretty easily, and some left scars.  I figured I&apos;d post some of them here and hopefully save some other Flex n00bs the hassle of figuring things out the hard way.&lt;/p&gt;

&lt;p&gt;The application that I&apos;m currently working on is fairly straightforward.  Let&apos;s call it a user manager.  I present a couple of comboboxes that let the user filter by certain criteria (state, 
zipcode, etc) and populate a DataGrid with the list of users that were returned.&lt;/p&gt;

&lt;p&gt;I chose to pass these values in a single object.  In ColdFusion, this single object would be a structure.  Flex, or more appropriately, ActionScript, has a comparable datatype, simply called Object.  an Object would be created as follows:&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
var args:Object = new Object();
args.stateCode = &quot;CA&quot;;
args.zipCode = &quot;94583&quot;;
args.territory = 3;
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Fairly straightforward when compared to a ColdFusion structure:&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;brush: cf&quot;&gt;
&amp;lt;cfset args = structNew() /&gt;
&amp;lt;cfset args.stateCode = &quot;CA&quot; /&gt;
&amp;lt;cfset args.zipCode = &quot;94583&quot; /&gt;
&amp;lt;cfset args.territory = 3 /&gt;
&lt;/pre&gt;&lt;/p&gt;  [More]
				</description>
				
				<category>ColdFusion</category>
				
				<category>Flex</category>
				
				<category>Flex for CF&apos;ers</category>
				
				<pubDate>Thu, 17 Apr 2008 08:52:00 -0500</pubDate>
				<guid>http://charlie.griefer.com/blog/index.cfm/2008/4/17/flex-Objects-are-like-structures</guid>
				
				
			</item>
			</channel></rss>