your first getEstimate() shoudl do it, the second will only return to Object in Flex. Now, that said, I believe you need setters/getters on all vars in your CFC, this might be the case for sending from Flex to CF, but not sure, its been a whole year since I messed with CF that much :) Also note two things about CFCs and arrays. To return a array of foo.cfc you use returntype="com.meridien.foo[]" to specify a array of foo. Secondly, arrays in CFCs do not map to arraycollections in Flex. you can see my post here http://www.cubicleman.com/2007/02/13/coldfusion-and-flex-composite-cfcs-and-arrays/ on how to get around that if you really need a arraycollection in your Flex UI.
HTH! DK On Thu, Jul 17, 2008 at 12:25 PM, Tom McNeer <[EMAIL PROTECTED]> wrote: > I'm trying to solve an issue I posted about earlier, where a call to a > method of a ColdFusion CFC resulted in an error saying that the required > parameter - Estimate - was missing, even though I could see through > ServiceCapture that the object was, in fact, being sent. > > I'm working on the theory that it's an object translation problem. So I'm > testing by calling a getEstimate() method on the CFC as the Flex app starts > up, which should return an empty instance of an Estimate. However, the > incoming result is being identified as an ObjectProxy, rather than being > matched to the Estimate.as VO. And for the life of me, I can't figure out > why. I have many other VO/CFC combinations in the application, all being > matched up correctly. But the Estimate object just won't fly. > > I'm hoping someone here can help me figure it out. > > For reference, here's Estimate.as: > ======================== > package model > { > [RemoteClass(alias="meridien.model.estimate")] > > > [Bindable] > public class Estimate > { > public var estimateID:int = 0; > public var order:Order = new Order; > public var customer:Customer = new Customer; > public var configAC:ArrayCollection = new ArrayCollection; > > public function Estimate(data:Object = null) > { > } > } > > } > } > ========================= > > Here's estimate.cfc > ========================= > <cfcomponent output="false"> > <cfproperty name="estimateID" type="numeric" default="0" /> > <cfproperty name="order" type="meridien.model.products.order" /> > <cfproperty name="customer" type="meridien.model.customer.customer" /> > <cfproperty name="configAC" type="array" default=""> > </cfcomponent> > ========================= > > In my getEstimate() method, I have tried creating the object which I sent to > Flex in two ways: > ========================= > <cffunction name="getEstimate" access="remote" output="false" > returntype="any"> > <cfset var estimate = > createObject("component","meridien.model.estimate")> > <cfreturn estimate /> > </cffunction> > > ... and > > <cffunction name="getEstimate" access="remote" output="false" > returntype="any"> > <cfset var estimate = structNew()/> > <cfset estimate['__type__'] = "meridien.model.estimate"> > <cfset estimate['estimateID'] = 1 /> > <cfset estimate['order'] = > createObject("component","meridien.model.products.order") /> > <cfset estimate['customer'] = > createObject("component","meridien.model.customer.customer") /> > <cfset estimate['configAC'] = arrayNew(1) /> > <cfreturn estimate /> > </cffunction> > ============================= > > Neither work. The nested objects -- Customer and Order -- are recognized and > translated in Flex. But the outer Estimate object isn't. > > Can anyone see what I'm doing wrong here? (All paths are correct, by the > way.) > > -- > Thanks, > > Tom > > Tom McNeer > MediumCool > http://www.mediumcool.com > 1735 Johnson Road NE > Atlanta, GA 30306 > 404.589.0560 > -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?