<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FlexOOP &#187; cfproperty</title>
	<atom:link href="http://flexoop.com/tag/cfproperty/feed/" rel="self" type="application/rss+xml" />
	<link>http://flexoop.com</link>
	<description>Flex, AIR, ColdFusion, and everything in between</description>
	<lastBuildDate>Tue, 13 Jul 2010 03:56:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Inheritance between ColdFusion and Flex</title>
		<link>http://flexoop.com/2008/09/inheritance-between-coldfusion-and-flex/</link>
		<comments>http://flexoop.com/2008/09/inheritance-between-coldfusion-and-flex/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 19:53:17 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[cfproperty]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=31</guid>
		<description><![CDATA[I ran into a problem today with inheritance in an object in ColdFusion and passing that object back to Flex.  This is the second time I&#8217;ve encountered it, and was reminded by an old co-worker of the solution, in one of those &#8220;Duh!&#8221;, forehead-slapping moments I had created all of my objects in Flex, and [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a problem today with inheritance in an object in ColdFusion and passing that object back to Flex.  This is the second time I&#8217;ve encountered it, and was reminded by an old co-worker of the solution, in one of those &#8220;Duh!&#8221;, forehead-slapping moments <img src='http://flexoop.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I had created all of my objects in Flex, and then they were mapped by a coworker to the ColdFusion objects on the backend.  He was returning objects back to my Flex components via AMF, but for some reason, the returned object only had the properties for the object that was specifically being called, with none of the properties for the item that it was extending, even though, the properties were being set correctly in ColdFusion.</p>
<p>It turns out that all that was needed was to add the &lt;cfproperty&gt; tags for each of the inherited properties.  Once those were added the previously missing properties were exposed to Flex and passed back correctly.</p>
<p>e.g.<br />
Activity object</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfcomponent</span> displayname<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;activity&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfproperty</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;action&quot;</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfproperty</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;type&quot;</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfcomponent</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>Review object</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfcomponent</span> displayname<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;review&quot;</span> extends<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;path.to.cfc.activity&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfproperty</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;reviewDate&quot;</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfcomponent</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>If the review object was returned to Flex, it would only pass back &#8220;reviewDate&#8221;, but none of the properties of the object it is extending.  This is due to the review object only having the reviewDate cfproperty.  In order to get it to return all properties (from review and activity), you would have to do this:<br />
New and Improved Review object</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfcomponent</span> displayname<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;review&quot;</span> extends<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;path.to.cfc.activity&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfproperty</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;action&quot;</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfproperty</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;type&quot;</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfproperty</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;reviewDate&quot;</span> <span style="color: #0000FF;">value</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfcomponent</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>Now you will get all of the review object properties, plus the properties inherited from activity.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexoop.com/2008/09/inheritance-between-coldfusion-and-flex/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

