Adobe COLDFUSION 9 Manual page 834

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
To update or delete data dynamically, do the following:
• Specify
selectmode="edit"
• Specify an
attribute in the
onChange
JavaScript function, or URL of a page that updates the data source. The bind expression has the same format as the
bind expression described in
parameters that the grid automatically passes. These parameters send information about the grid and its state to the
function.
onChange
Parameter name
cfgridaction
cfgridrow
cfgridchanged
When you update data dynamically, you can also use the
to handle any errors that result in a CFC or URL returning an HTTP error status. The method must take two
parameters: the HTTP error code and a text message that describes the error. The following example shows an
handler function:
onError
<script type="text/javascript">
function errorhandler(id,message) {
alert("Error while updating \n Error code: "+id+" \nMessage:
"+message);}
</script>
The following
displays the members of a department and lets users edit the data in the fields. When the focus
example
leaves the edited field an onChange event triggers and the form calls the
source.
in the
tag. This lets the user edit the grid.
cfgrid
tag. The attribute must use a bind expression to specify a CFC method,
cfgrid
"Dynamically filling form
data" on page 825; however, it must take the following bind
Description
The action performed on the grid. 'U' for update, or 'D' for delete.
A structure or JavaScript Object whose keys are the column names and values are the original values
of the updated or deleted row.
A structure or JavaScript Object with a single entry, whose key is the name of the column with the
changed value, and whose value is the new value of the field. If the grid action is delete, this structure
exists but is empty.
onError
Last updated 8/5/2010
attribute to specify the name of a JavaScript function
CFC function to update the data
editData
829

Advertisement

Table of Contents
loading

Table of Contents