Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 874

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
<html>
<head>
<script language="javascript">
function test(x,y){
return "Hello, " + x + "!";
}
function callbackHandler(result){
alert("Bind expression evaluated. Result: \n" + result);
}
</script>
<cfajaxproxy bind="javascript:test({input1@none},{button1@click})"
onSuccess="callbackHandler">
</head>
<body>
<cfform name="mycfform">
<cfinput type="text" value="" name="input1" size="30">
<cfinput type="button" name="button1" value="Submit">
</cfform>
</body>
</html>
Getting bindable attribute values in JavaScript
Use the
ColdFusion.Ajax.submitForm
a bindable control. This technique is useful for getting values for complex controls such as
more information, see the ColdFusion.Ajax.submitForm function in the CFML Reference.
Managing the client-server interaction
Manage the client-server interaction in several ways:
• Use the
tag to create a client-side JavaScript proxy for a CFC and its functions. You then call the
cfajaxproxy
proxy functions in client JavaScript code to access the server-side CFC functions.
• Use the
cfsprydataset
set to populate Spry dynamic regions. You also use Spry data sets in bind expressions.
• Use the
tag to bind fields of ColdFusion Ajax form controls as parameters to a specific CFC function,
cfajaxproxy
JavaScript function, or HTTP request, and specify JavaScript functions to handle successful or error results. The
function is run each time the event determined by the bind expression occurs.
• Use ColdFusion Ajax-based UI tags, such as
using data binding.
For Information on working with Spry, including how to use the
ColdFusion" on page 874. For detailed information on using binding, including how to use binding with ColdFusion
UI tags and the
cfajaxproxy
ColdFusion Ajax-based UI tags, see
function in your JavaScript code to get the current value of any attribute of
tag to dynamically populate a Spry data set from a URL or a CFC. You then use the data
or
cftree
tag, see
"Binding data to form
"Using Ajax User Interface Components and
Last updated 1/20/2012
that automatically get data from CFCs or URLs by
cfgrid
tag, see
cfsprydataset
fields" on page 860. For more information on using the
Features" on page 804.
and
. For
cfgrid
cftree
"Using Spry with
869

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents