Hmm, I'm not a CF programmer, but can you really call cfset before
calling cfargument inside a cffunnction? 

Anyway, try specifying a dummy second CFC argument to stop it thinking
named arguments are being sent.

<cffunction name="fn_getEmpDets" access="remote" returntype="string">
<cfargument type="struct" name="cs" required="yes">
<cfargument type="any" name="dummy" required="no">
<cfset chkStruct = "No">
<cfif isStruct(cs)>
<cfset chkStruct = "yes">
</cfif>
<cfreturn chkStruct>
</cffunction>




-----Original Message-----
From: Mohanraj Jayaraman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 16, 2005 3:14 PM
To: [email protected]
Subject: RE: [flexcoders] Handling Complex Data With Remote Object and
Coldfusion CFC



Hi Erik,

Thanks for your comments.

I am not able to receive the Object at CFC.

Actually 
I have simple form say with Form Item's Name and
Description.

When I submit this form I would like pass this as an
Object to my CFC instead of passing them as individual
parameters.

When I pass this object to CFC, it returns with the
error message 'The required parameter was not passed'.

Any idea what I am missing here? 


Here's my code sample

MXML
---------

var emp:Object;

function initApp() {
emp=new EmpDets();
}
                
function fnGetNm() {
emp.Name=txt_nm.text;
emp.Desc=txt_desc.text;
GetNm1.fn_getEmpDets(emp);         
}


<mx:RemoteObject id="GetNm1"
endpoint="http://127.0.0.1:8500/flashservices/gateway";
source="home.reus.components.GetNm"  
showBusyCursor="true">
<mx:method name="fn_getEmpDets"  
result="myRes=event.result" />
</mx:RemoteObject>


EmpDets.as 
----------------------


class EmpDets{

public var Name : String;
public var Desc : String;
}




GetNm.cfc
------------


<cffunction name="fn_getEmpDets" access="remote"
returntype="string">
<cfset chkStruct = "No">
<cfargument type="struct" name="cs" 
required="yes" >
<cfif isStruct(cs)>
<cfset chkStruct = "yes">
</cfif>
<cfreturn chkStruct>
</cffunction>









--- Erik Westra <[EMAIL PROTECTED]> wrote:
> Well u can send all kinds of datatypes through
> RemoteObject to your CFC:
> 
> Flash - ColdFusion
> ======================
> Object - Struct 
> Array - Array
> Boolean - Boolean
> Number - Number
> String - String
> 
> 
> ColdFusion - Flash
> ======================
> Struct - Array (with named keys)
> Array - Array
> Boolean - String
> Number - Number (with CF7 u need to put Val()
> around the 
> number, else its returned as
> String)
> String - String
> 
> 
> Greetz Erik
> 
> 
> 
> -----Original Message-----
> From: reachmohanraj [mailto:[EMAIL PROTECTED]
> 
> Sent: dinsdag 15 maart 2005 22:17
> To: [email protected]
> Subject: [flexcoders] Handling Complex Data With
> Remote Object and
> Coldfusion CFC
> 
> 
> 
> Hi,
> 
> My Environment
> --------------
> Coldfusion 6.1
> Flex 1.5
> 
> I would like to pass a complex object
> (Name,Title,Phone Number) as a
> parameter to my CFC function.
> 
> I should be able to process this complex data in CFC
> and have to insert
> multiple rows into the table.
> 
> How can I pass such complex data through my Remote
> Object call?
> Can someone post a simple example?
> 
> Thanks,
> Mohanraj
> 
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 


 
Yahoo! Groups Links



 





Reply via email to