Adobe COLDFUSION 9 Manual page 873

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
• The
function handles a valid return from the function or page and updates the display as required with
onSuccess
the returned information.
Binding a function or request by using the
updating a database by using bind parameter values based on a user action in some control, and then run a specific
action or set of actions in one or more controls based on the server response. Because it uses an
to process the return from the server, this form of binding provides substantially more flexibility than a CFML control
parameter. This format also lets you use a control
bind
tag for a different activity.
For example, if you have a form with an editable
row. The application must have the following behaviors:
• When the user clicks the delete button two things must happen:
• The application must call a mycfc.deleteButton CFC function to delete the row from the database.
• The grid must update to remove the deleted row.
• When the user edits the grid content, the grid must call a
Implement these behaviors by doing the following:
• In the
tag, specify a
cfgrid
user changes the grid contents.
• In a
tag, specify a
cfajaxproxy
attribute that calls the
onSuccess
CFC function returns successfully.
The following code snippets show how you could do this:
<cfajaxproxybind="cfc:mycfc.deleteRow({deletebutton@click},
{mygrid.id@none}"onSuccess="ColdFusion.Grid.refresh('mygrid', true)">
...
<cfinput type="button" name="deletebutton">
<cfgrid name="mygrid" bind="mycfc.update({cfgridpage}, {cfgridpagesize},
{cfgridsortcolumn}, {cfgridsortdirection})>
The following complete example shows a simple use of the
the bind expression calls a JavaScript function; as a result, the
tag enables you to perform a server-side action, such as
cfajaxproxy
bind
control and a delete button that a user clicks to delete a grid
cfgrid
attribute that uses a bind expression to call a mycfc.update function each time the
bind
attribute that calls the mycfc.deleterow CFC function, and specify an
bind
ColdFusion.Grid.refresh
bind
Last updated 8/5/2010
parameter for one kind of action, and the
function to update the database.
mycfc.update
function to update the displayed grid when the
attribute in a
cfajaxproxy
tag cannot use a
cfajaxproxy
function
onSuccess
cfajaxproxy
tag. For the sake of brevity,
attribute.
onError
868

Advertisement

Table of Contents
loading

Table of Contents