Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 886

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Importing tag-specific JavaScript files
In the following situations, ColdFusion does not automatically import the JavaScript files that are required for Ajax-
based tags:
• If you use a ColdFusion Ajax-based tag on a page that you specify by using a
tag, such as
,
cfdiv
cflayoutarea
container tag and use the
have to do this for any tags that are also used on the page with the
• If you use a ColdFusion Ajax JavaScript function, such as ColdFusion.Window.create or ColdFusion.navigate, on
a page that does not otherwise import the required ColdFusion Ajax JavaScript functions, use the
tag to import the required JavaScript functions. If you are using a function, such as
not used for a specific control, you can omit any attributes; the default behavior is to import the base functions that
are not control-specific. If you are using a function such as
and identify the associated control, for example,
<cfajaximport tags="cfwindow">
For detailed information on importing tag-specific JavaScript files, see the cfajaximport tag in the CFML Reference.
Using data interchange formats
All complex data that is communicated over an HTTP connection must be serialized into a string representation that
can be transmitted over the web. Most commonly, web client applications use XML or JSON.
As a general rule, ColdFusion automatically handles all necessary serialization and deserialization when you use
ColdFusion Ajax features. The proxies that you create with the
CFC functions automatically request data in JSON format, and automatically deserialize JSON data to JavaScript
variables.
ColdFusion also provides the capability to create, convert, and manage data in web interchange formats. This is
helpful, for example, if you use custom Ajax elements to get data from ColdFusion servers.
Also, you use ColdFusion data serialization capability for any applications that create or consume complex data
transmitted over an HTTP connection. For example, if you want to make a web service or feed available in JSON
format, many Yahoo! web services currently are accessible by using simple URLS that return data as JSON.
Note: For information on ColdFusion tags and functions for handling XML or WDDX data, see
WDDX" on page 1058.
Controlling CFC remote return value data format
By default, CFC functions convert data that they return to remote callers to WDDX format. However, they can also
return the data in JSON format, or as plain string data. (XML objects are automatically converted to string
representation when returning plain data.)
ColdFusion Ajax elements that request data from CFC functions, including bind expressions and the function proxies
generated by the
cfajaxproxy
JSON data from the CFC function.
Control the CFC function return format in the following ways:
• Use the
attribute on the
returnFormat
• Set a
parameter in the HTTP request that calls the CFC function.
returnFormat
• Use the CFC proxy
setReturnFormat
format data, for example, XML or WDDX.)
,
, or
cfpod
cfwindow
attribute to specify the Ajax feature tags that are on the other pages. (You do not
tags
cfwindow
tag, automatically generate a
tag.
cffunction
function. (You do this only if your client-side code requires non-JSON
Last updated 1/20/2012
or
source
. Place a
tag on the page that has the
cfajaximport
attribute.)
source
coldFuson.navigate
ColdFusion.Window.create
in the following line:
tag, and the bind expressions that call
cfajaxproxy
parameter in the HTTP URL to request
returnFormat
attribute in a container
bind
cfajaximport
, that is
, use the
attribute
tags
"Using XML and
881

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents