Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / July 2005



Tip: Looking for answers? Try searching our database.

AS Array to CFC

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TK01 - 24 Jul 2005 16:27 GMT
Hi,

I'm having problems passing an associative array to a CFC function via
Remoting.

The service call is working fine, having trouble getting the data out the
array.

Here is my AS:

//the array
infoForm_arr["fname"] = fname_txt.text;
infoForm_arr["lname"] = lname_txt.text;
infoForm_arr["email"] = email_txt.text;
infoForm_arr["phone"] = phone_txt.text;
infoForm_arr["address"] = address_txt.text;
infoForm_arr["city"] = city_txt.text;
infoForm_arr["state"] = state_txt.text;
infoForm_arr["zip"] = zip_txt.text;
infoForm_arr["comments"] = comments_txt.text;

//call funtion to call service
submitInfo(infoForm_arr);

//the array is passed as parameter to
//service call:

var pc:PendingCall=submitInfoService.submitInfo(infoForm_arr);

Here is the CFC function:

<cffunction name="submitInfo" access="remote" returntype="query">
<cfargument name="infoForm_arr" type="struct">

<cfset fname=infoForm_arr.fname>
<cfset lname=infoForm_arr.lname>
<cfset email=infoForm_arr.email>
<cfset phone=infoForm_arr.phone>
<cfset address=infoForm_arr.address>
<cfset city=infoForm_arr.city>
<cfset state=infoForm_arr.state>
<cfset zip=infoForm_arr.zip>
<cfset comments=Flash.Params[1].comments>

<cftransaction>

<cfquery name="q_insertOrder" datasource="ds" username="username"
password="william">

INSERT INTO people(fname, lname, email, phone, address, city, state, zip,
comments)
VALUES(fname, lname, email, phone, address, city, state, zip, comments)

</cfquery>

<cfquery name="q_getRecord" datasource="ds" username="username"
password="william">
SELECT MAX(order_id) as NewID
FROM orders
</cfquery>

</cftransaction>

<cfreturn q_getRecord>

</cffunction>

the cfc generates a new primary key on the table but know data is going in.

Any help would be great.
TK01 - 25 Jul 2005 17:44 GMT
ok, I'm totally frustrated. my code is just the the example code in the
livedocs.

why doesn't this work? No one in any of the forums I've posted has responded.

i need to do something similar with a complex, nested associative array. err.

I don't get it.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.