Proxy Actionscript Classes For Coldfusion Services - Adobe COLDFUSION 9 Manual

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
If
the changes in the local database are committed to the server when the
true,
methods are used as shown here:
private var syncmanager:SyncManager = new SyncManager();
syncmanager.autoCommit = true;
This functionality helps you minimize the conflicts during the synchronization with the server, particularly in the case
of auto-generation of primary key on client and serverside.
New attribute for SessionResultEvent and SessionToken
The classes
SessionResultEvent
with the auto-generated ID used by ActionScript ORM.
by the ActionScript ORM in that specific call.
Example
private function connectSuccess(event:SessionResultEvent):void
{
// Generate an Order Obect
.
.
.
.
// Save the Order
var savetoken:SessionToken = session.save(ord);
savetoken.addResponder(new mx.rpc.Responder(savesuccess, savefault));
}
private function savesuccess(event:SessionResultEvent):void
{
// This is how, you can access autogenrated PK
RememberINTPK = event.autoGeneratedId.toString();
var loadtoken:SessionToken = session.loadByPK(Order,{oid:RememberINTPK},true);
loadtoken.addResponder(new mx.rpc.Responder(loadsuccess,loadfailure))
}
Note: Assume that the server database generates primary keys and you choose to generate primary key on client SQL Lite
table (as shown in the example). This scenario results in a conflict which the application developer must resolve. An
option is to design your application in such a way that you minimize conflicts between client and server objects. In this
case, you can set client object primary keys as null or empty string before saving data to the database server using
serverside ORM EntitySave function.

Proxy ActionScript Classes for ColdFusion Services

Flex-based applications in AIR and Flash can access several ColdFusion services by using ColdFusion proxy
ActionScript classes. This feature is available in all Flex-based applications that run on Flash and AIR. ColdFusion
provides services corresponding to the following tags and their child subtags:
,
,
. Using ColdFusion you can also upload files from the application to the server.
cfmail
cfpdf
cfpop
ColdFusion provides the following Flex proxy classes and related support classes:
• Config (configures the application for using ColdFusion services)
• Util (includes file upload support)
• Chart (cfchart)
and
have a new attribute
SessionToken
autoGeneratedId
Last updated 8/5/2010
,
and
save
saveUpdate,
that gets populated
autoGeneratedId
is populated only when a key is generated
,
,
cfchart
cfdocument
cfimage
653
remove
,

Advertisement

Table of Contents
loading

Table of Contents