Wednesday 10 Mar 2010   
Add Comment

Posting data from Flex to Coldfusion PDF's

Flex / ColdFusion Tutorial #18

This tutorial demonstrates how simple it is to post to an external application as it’s a standard get you could send this off to any server side language.

Tutorial18.mxml

Create a URL Variables object : var args:URLVariables = new URLVariables(); and add onto it anything you need to post. Then use navigateToURL(url, '_blank'); to open it a new window. This can be useful to direct someone to a download link page in HTML for example.
Using navigateToURL(url, '_self'); you can allow the user to download a file without poping a new window providing the url is a link to a file or a .cfm that's serving up a file ( ie <cfcontent type="application/vnd.ms-excel" > ).

 
 


report.cfm

Depending on the "type" sent from Flex display HTML output or build a simple PDF with <cfdocument>

 
 


Demo

See this code running!


Download

Download this code as a zip!


Comments

What if instead of passing data from the form, you wanted to pass the ID of a selected grid data? Any ideas?
Ryan @ Friday 15 Jan 2010 - 08:04:16 AM

Sure that would be the same but the post variable would be dataGrid.selectedItem.idField
Paul @ Monday 18 Jan 2010 - 04:27:36 PM

Click button to add a comment


Author

Paul Kukiel


Published

Tuesday 17 Mar 2009

Tags

cfdocument  cfelse  cfif  cflocation  cfoutput  mx:Application  mx:Button  mx:Form  mx:FormItem  mx:Script  mx:TextInput 

Rosetta Stone