My last Flex blog post demonstrated Flex as a ColdFusion client, a n-tier application using ColdFusion as the logic layer and Flex as the presentation layer. Here is another way to integrate Flex and ColdFusion; dynamically generated Flex.
Click on URL http://www.forta.com:8100/cf/flex/tree.cfm to see an example of a Flex tree. It is a really simple example, and mildly impressive at best. So why am I posting this? Look at the URL, it is a .cfm URL, not a .mxml url.
Christophe Coenraets posted a really useful entry on using the Flex JSP Tag Library so as to be able to generate MXML inline within a JSP page. (See http://www.markme.com/cc/archives/004021.cfm).
Can ColdFusion users do the same? Absolutely, that’s exactly what the tree example is doing. ColdFusion can import and invoke JSP tags, and the Flex JSP tags are no exception.
Here is the CFML code used in this example:
Flex Embedded in ColdFusion
In this example I hard-coded the menu contents to keep things simple, but you can imagine using queries or CFCs or any CFML code here. This type of integration, being able to use both CFML and MXML together, makes it really easy to create ColdFusion/Flex applications.
Leave a Reply