Marius,

Here's some sample code. I'm dumping the WDDX packet into a client variable
which is used in another frame.

<cfscript>
Basket=StructNew();
rc=StructInsert(Basket, "Item", "#Trim(getPartInfo.item_no)#");
rc=StructInsert(Basket, "Description", "#Trim(getPartInfo.item_desc_1)#");
rc=StructInsert(Basket, "Price",
"#Trim(NumberFormat(getPartInfo.Price,'99999.99'))#");
rc=StructInsert(Basket, "Prod_cat", "#Ucase(getPartInfo.prod_cat)#");
rc=StructInsert(Basket, "Std_cost",
"#Trim(NumberFormat(getPartInfo.std_cost,'99999.99'))#");
rc=StructInsert(Basket, "DiscRate", "#Trim(Variables.DiscRate)#");
rc=StructInsert(Basket, "DiscPrice", "#Trim(Variables.DiscPrice)#");
rc=StructInsert(Basket, "PriceBreakQty", "#Trim(Variables.PriceBreakQty)#");
rc=StructInsert(Basket, "PriceBasis", "#Trim(Variables.PriceBasis)#");
rc=StructInsert(Basket, "PriceCodeType", "#Trim(Variables.PriceCodeType)#");
</cfscript>

<cfwddx action="CFML2WDDX" input="#Basket#" output="ItemInfo">
<cfset Client.ItemInfo=ItemInfo>

============================================================

<cfwddx action="WDDX2CFML" input="#Client.ItemInfo#" output="wddxBasket">

<cfoutput>
#wddxBasket.Item#
#wddxBasket.Description#
ETC.
</cfoutput>

Regards,

Chris



-----Original Message-----
From: Marius Milosav [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 7:42 PM
To: CF-Talk
Subject: Passing a structure to JavaScript with wddx


If anybody passed successfully a structure with wddx can you please let me
know how.

<cfwddx action="cfml2js" input="#myST#" toplevelvariable="stMsg">
gives a JavaScript error. :
; expected

It works fine if I pass arrays or queries.
myST is a valid structure and is populated

Thanks

Marius Milosav
www.scorpiosoft.com
It's not about technology, it's about people.
Virtual Help Desk Demo (VHD)
www.scorpiosoft.com/vhd/login.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to