Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 872

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
• It calls a CFC, which uses only the first letter of the first name when forming the e-mail address, and forces the
domain name to be all lowercase.
The following example shows the bindapp.cfm page:
<html>
<head>
</head>
<body>
<cfform name="mycfform">
First Name: <cfinput type="text" name="firstname" value=""><br>
Last Name: <cfinput type="text" name="lastname" value=""><br>
Domain: <cfinput type="text" name="domain" value=""><br>
E-mail: <cfinput type="text" name="email"
bind="cfc:bindFcns.getEmailId({firstname@keyup},{lastname@keyup},
{domain@keyup})">
</cfform>
</body>
</html>
The following example shows the bindFcns.cfc CFC file:
<cfcomponent>
<cffunction name="getEmailId" access="remote">
<cfargument name="firstname">
<cfargument name="lastname">
<cfargument name="domain">
<cfreturn
"#left(arguments.firstname,1)#.#arguments.lastname#@#lcase(arguments.domain)#">
</cffunction>
</cfcomponent>
Many of the examples in the documentation for ColdFusion Ajax features use binding, including more complex forms
of binding.
Using the cfajaxproxy tag to bind to display controls
The
tag with a
cfajaxproxy
ColdFusion Ajax controls:
• A single CFC function
• A single JavaScript function
• An HTTP request; for example, the URL of a CFML page
The function or request executes whenever a specific event (by default, the
occurs.
Note: if you specify a bind attribute with a URL, the HTTP request includes a _
checks this value, and when it is
send. This behavior ensures that JSON responses to Ajax requests do not include any non-JSON (that is, debugging
information) text.
The
tag includes the following attributes that determine how the proxy handles the data returned by the
cfajaxproxy
function or the page:
• The
function specifies code to handle an HTTP error return. You use this attribute with a URL or CFC bind.
onError
attribute makes any of the following elements dependent on one or more bound
bind
, does not append to the response any debugging information that it normally would
true
Last updated 1/20/2012
event) of the bound control
onChange
_
URL parameter. ColdFusion
CF
NODEBUG
867

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents