
652
DEVELOPING
COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
Las
t
upda
te
d 8/5/2010
Returns
An instance of
coldfusion.air.SessionToken
associated with
keepClientObject
call.
Syntax
public function keepClientObject(conflict:coldfusion.air.Conflict):SessionToken
Parameters
Example
See the example in the section
keepAllClientObjects
. For
keepClientObject
, the only difference is that you must
iterate over each conflict in the conflictarray collection.
Offline AIR SQLite API enhancements
The following new parameters for
openSession
:
SessionToken class is dynamic
A class is dynamic in ActionScript if you can add additional key-value pairs to the instance of the class.
In this release,
sessionToken
is dynamic class. Therefore, you can add additional information that can be passed from
where the API is called to the success or fault handlers.
Example
private function fetchData():void
{
var token:AsyncToken= syncmanager.fetch("fetch");
token.addResponder(new mx.rpc.Responder(fetchSuccess, fetchFault));
// Test For SessionToken class to be Dynamic, so that Dynamic Properties could
be added
token.
userdefined_key
= "
value
";
}
public function fetchSuccess(event:SyncResultEvent):void
{
if(event.token.userdefined_key == "value")
{ .... }
}
Support for AutoCommit
SyncManager supports a Boolean property
autoCommit
.
The default value is
false
.
Parameter
Description
coldfusion.air.Conflict
The conflict that the server raises.
New Parameters
Type
Required/Optional
Description
encryptionKey
ByteArray
Optional
Used to encrypt offline SQLite database. For details, see “
Encrypting
the database
” on page
648.
cacehDirectory
File
Optional
Used to specify a custom cache directory. For details, see “
Specifying
the cache directory
” on page
648.