Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 649

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
Alert.show("Commit Failed::"+event.error);
}
private function loadFault(event:SessionFaultEvent):void
{
Alert.show("Load Failed::"+event.error);
}
private function updatefualt(event:SessionFaultEvent):void
{
Alert.show("update fault"+event.error);
}
private function savefault(event:SessionFaultEvent):void
{
Alert.show("Save Fault::"+event.error);
}
]]>
</mx:Script>
<mx:Button click="commit()" name="commitbutton"
label="Commit/write local data to Server">
</mx:Button>
</mx:WindowedApplication>
Server-side code
Create the following cfc files - Application.cfc, Customer.cfc, Address.cfc, and Cusmanager.cfc with code like the
following. The AIR client interacts with the Cusmanager.cfc file, in which you specify the code to fetch and sync the
data back to the server.
Application.cfc
<cfcomponent>
<cfset this.name = "OneTonOneExample">
<cfset this.datasource="testorm">
<cfset this.ormenabled="true">
<cfset this.ormsettings={dialect = "MicrosoftSQLServer"}>
</cfcomponent>
Customer.cfc
<cfcomponent persistent="true">
<cfproperty name="cid" fieldtype="id" >
<cfproperty name="name" >
<cfproperty name="address" fieldType='one-to-one'
CFC="address" fkcolumn='aid' cascade='all' >
</cfcomponent>
Address.cfc
<cfcomponent persistent="true">
<cfproperty name="aid" fieldtype="id" >
<cfproperty name="street" >
</cfcomponent>
Last updated 1/20/2012
644

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents