Solved

when working with a WDDX packet is there a way to loop through the fieldNames

Posted on 2008-10-21
1
793 Views
Last Modified: 2011-09-20
I would like to be able to loop through the fieldnames of a wddx packet and place them into a strcut.  

I use this line to convert it back to cfm <cfwddx action="wddx2cfml" input="#wddxPacket#" output="orders">

So how do I use this to loop through the fieldnames?
<wddxPacket version='1.0'><header/><data><struct><var name='Customer_Addresses'><recordset rowCount='1' fieldNames='STRTABLE,GUIDADDRESSID,GUIDCUSTOMERID,INTADDRESSTYPE,TXTCOMPANYNAME,TXTNAME,TXTADDRESS1,TXTADDRESS2,TXTADDRESS3,TXTCITY,TXTSTATE,TXTZIP,INTCOUNTRYID,TXTPHONE,TXTFAX,TXTEMAIL,DATCREATED' type='coldfusion.sql.QueryTable'>

<field name='STRTABLE'>

<string>Customer_Addresses</string></field><field name='GUIDADDRESSID'><string>1c570882-c506-4b20-8a0b-55c58c5b33ef</string></field><field name='GUIDCUSTOMERID'><string>583d703a-75c9-412f-aaef-fcfac72d095d</string></field><field name='INTADDRESSTYPE'><number>0.0</number></field><field name='TXTCOMPANYNAME'><string></string></field><field name='TXTNAME'><string>michael thompson</string></field><field name='TXTADDRESS1'><string>235 s. bebe</string></field><field name='TXTADDRESS2'><string></string></field><field name='TXTADDRESS3'><string></string></field><field name='TXTCITY'><string>wichita</string></field><field name='TXTSTATE'><string>KS</string></field><field name='TXTZIP'><string>67209</string></field><field name='INTCOUNTRYID'><number>1.0</number></field><field name='TXTPHONE'><string>3169450278</string></field><field name='TXTFAX'><string></string></field><field name='TXTEMAIL'><string></string></field><field name='DATCREATED'><dateTime>2008-8-6T20:14:1-5:0</dateTime></field></recordset></var>

Open in new window

0
Comment
Question by:monica73174
1 Comment
 
LVL 14

Accepted Solution

by:
Scott Bennett earned 500 total points
ID: 22772348
When you use cfwddx to convert the wddx to cfml it automatically creates a structure with the variable name you specify in the output parameter. based on your wddx packet it looks like it would create a coldfusion structure named orders that has a structkey of customer_addresses that contains a query result set. You could loop through that result set like this:


<cfwddx action="CFML2WDDX" input="#mywddxstring#"  output="orders">
 

<cfoutput query="orders.Customer_Addresses">

#orders.Customer_Addresses.STRTABLE#<bt>

#orders.Customer_Addresses.GUIDADDRESSID#<br>

#orders.Customer_Addresses.GUIDCUSTOMERID#<br><br>

</cfoutput>

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
URGENT: Web Server Configuration Tool not working after ColdFusion 11 license update 10 414
<cfquery> to Excel 5 56
expandPath erroring 15 57
Using a variable with dateAdd 18 66
This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now