Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 629

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
Elements
use-accessors
use-structs
force-cfc-lowercase
force-query-lowercase
force-struct-lowercase
Use the CFC
Use the CFC in your application:
In the MXML file, you use the
1
connection, you can call any remote method on the CFC.
If you created a destination for the CFC in the remoting-config.xml file, specify the destination name in the
2
tag; for example:
mx:RemoteObject
<mx:RemoteObject
id="a_named_reference_to_use_in_mxml"
destination="CustomID"
result="my_CFC_handler(event)"/>
If you did not create a destination for the CFC, specify the ColdFusion destination and the CFC path in the
tag; for example:
mx:RemoteObbject
<mx:RemotObject
id="myCfc"
destination="ColdFusion"
source="myApplication.components.User"/>
3
Call a CFC method, for example, as the following example shows:
<mx:Button label="reload" click="my_CFC.getUsers()"/>
In this example, when a user presses a button, the Click event calls the CFC method getUsers.
Specify a handler for the returned result of the CFC method call for the
4
example shows.
private function my_CFC_handler( event:ResultEvent )
{
// Show alert with the value that is returned from the CFC.
mx.controls.Alert.show(ObjectUtil.toString(event.result));
}
Compile and Run the application
You can compile and run your application from Flash Builder or without using Flash Builder. The techniques you can
use also depend on whether you have installed LiveCycle Data Services.
Description
Whether the Value Object CFC has getters and setters. Set the value of use-accessors to true if
there are getters and setters in the Value Object CFC.
Set the value of use-structs to true if you don't require any translation of ActionScript to CFCs. The
assembler can still return structures to Flex, even if the value is false. The default value is false.
Whether to make property names, query column names, and structure keys lowercase when
converting to ActionScript. Query column names must precisely match the case of the
corresponding ActionScript variables. The default value is
tag to connect to your CFC named resource. With this
<mx:RemoteObject>
Last updated 1/20/2012
false
.
tag, as the following
<mx:RemoteObject>
624

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents