Example Application - MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Use Manual

Table of Contents

Advertisement

Example application

This section describes creating a Flex application that uses the ColdFusion Data Service
adapter and Flex Data Service assembler so that a ColdFusion component handles the back-
end database management.
You can download the source code for the files that are included in the Flex sample Contact
application from
"Using ColdFusion with Flex – Part 1: Creating and Running a Contact
Manager
Application." In addition, you can view the code for the Flex sample Contact
appliation in
"The Flex Contact Manager Application" on page
To use ColdFusion instead of the Java adapter:
Create the assembler CFC.
1.
Create the DAO CFC.
2.
Create the Value Object CFC.
3.
To make creating the CFCs easier, ColdFusion MX 7.0.2 includes wizards that you
can use in Flex Builder. For more information, see
Extensions for Flex
Specify the destination in the data-management-config.xml file.
4.
Copy the files for the Flex Contact sample application to the appropriate folders.
5.
Run the application.
6.
Creating the assembler CFC
The assembler CFC contains the
Creating the fill method
In the Contact sample application, the fill operation has two forms: one that takes no
argument, and one that takes a string. The corresponding Java function returns a List of
Contact objects. Because a List corresponds to an array in ColdFusion, the
returns an array of Contact objects. The
<cffunction name="fill" output="no" returntype="samples.contact.Contact[]"
access="remote">
<cfargument name="param" type="string" required="no">
<cfset var ret = ArrayNew(1)>
<cftry>
<cfset dao = CreateObject("component","samples.contact.ContactDAO")>
48
Using the Flex Data Service Assembler
Builder".
,
,
fill
sync
get
method appears as follows:
fill
62.
Chapter 5, "Using the ColdFusion
, and
methods.
count
method
fill

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents