Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 688

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
• Ensure that the query column names match the case of the properties in the ActionScript object. Use the
settings in the destination to do so. Set the
property-case
ColdFusion converts all column names to lowercase.
• If you are using an array of structures:
• Create the array to contain the Value Objects, as follows:
<cfset var ret = ArrayNew(1)>
• Loop through the query to create the structure that contains the results of the query, for example:
<cfloop query="qRead">
<cfscript>
stContact = structNew();
stContact["__type__"] = "samples.contact.Contact";
stContact["contactId"] = qRead.contactId;
stContact["firstName"] = qRead.firstName;
stContact["lastName"] = qRead.lastName;
stContact["address"] = qRead.address;
stContact["city"] = qRead.city;
stContact["state"] = qRead.state;
stContact["zip"] = qRead.zip;
stContact["phone"] = qRead.phone;
ArrayAppend(ret, duplicate(stContact));
</cfscript>
</cfloop>
• Use the
structure element to specify that the Value Object CFC is the type, for example:
__type__
stContact["__type_"] = "samples.contact.Contact";
• Use the associative array syntax, for example,
ActionScript property. If you use the other syntax, for example,
makes the key name uppercase.
Managing fills
To determine whether to refresh a fill result after an item is created or updated, you include a
in the assembler and set both
management-config.xml file. The following example shows a fill-method section:
<fill-method>
<use-fill-contains>true</use-fill-contains>
<auto-refresh>true</auto-refresh>
<ordered>false</ordered>
</fill-method>
In this example,
is set to
ordered
sorted, you set
to
ordered
true
The
method tells the Flex application whether it is necessary to run the fill again after an item in the
fillContains
fill result has changed. The
fillCcontains
change. When the
fillContains
The following example shows the
<cffunction name="fillContains" output="no" returnType="boolean" access="remote">
<cfargument name="fillArgs" type="array" required="yes">
<cfargument name="item" type="[CFC type object]" required="yes">
<cfargument name="isCreate" type="boolean" required="yes">
contact["firstName"]
and
use-fill-contains
auto-refresh
because the fill result is not sorted by any criteria. However, if the fill result is
false
. When an item changes in a fill result that is ordered, refresh the entire fill result.
method returns a value that indicates how the fill be treated for that
method returns
, the fill is executed after a create or update operation.
true
method signature:
fillContains
Last updated 1/20/2012
element to
force-query-lowercase
to ensure that you match the case of the
contact.firstName="Joan"
fillContains
to
in the fill-method section of the data-
true
683
so that
false
, ColdFusion
method

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents