Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 689

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
The
method has the following arguments:
fillContains
is a list of arguments to pass to the
fillArgs
is the record to check to determine if it is in the result set.
item
indicates whether the record is new.
isCreate
A sample
method, which determines whether the
fillContains
in the Contact item passed to the function, is as follows:
<cffunction name="fillContains" output="no" returnType="boolean"access="remote">
<cfargument name="fillArgs" type="array" required="yes">
<cfargument name="item" type="samples.contact.Contact" required="yes">
<cfargument name="isCreate" type="boolean" required="yes">
<cfif ArrayLen(fillArgs) EQ 0>
<!--- This is the everything fill. --->
<cfreturn true>
<cfelseif ArrayLen(fillArgs) EQ 1>
<!--- This is a search fill. --->
<cfset search = fillArgs[1]>
<cfset first = item.getFirstName()>
<cfset last = item.getLastName()>
<!--- If the first or last name contains the search string, --->
<cfif (FindNoCase(search, first) NEQ 0) OR (FindNoCase(search, last)
NEQ 0)>
<!--- this record is in the fill. --->
<cfreturn true>
<cfelse>
<!--- this record is NOT in the fill. --->
<cfreturn false>
</cfif>
</cfif>
<!--- By default, do the fill.--->
<cfreturn true>
</cffunction>
If you are running LiveCycle Data Services ES locally, you can determine whether a
client triggered fill. You do so by calling the DataServiceTransaction.getCurrentDataServiceTransaction().isRefill()
method in your ColdFusion application as follows:
<cfscript>
dst = CreateObject("java", "flex.data.DataServiceTransaction");
t = dst.getCurrentDataServiceTransaction();
isRefill = t.isRefill();
</cfscript>
This does not work over RMI when ColdFusion and Flex are not in the same web application.
Creating the get method
The
method retrieves a specific record. The get method calls the lower level
get
Bean/DAO methodology, as described in
method separately in the DAO CFC.
The following example shows the essential elements of a
method.
fill
fill
"Writing the ColdFusion
CFCs" on page 680, you create the lower level
method:
get
Last updated 1/20/2012
arguments (part of the first or last name) are
operation is a refresh or a
fill
method. If you use the
read
684
read

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents