MACROMEDIA COLDFUSION MX 61-CFML Reference page 157

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

Simple selection data (SelectMode = Single, Column, or Row)
The data that form variables return to the
which cells the user selected. In general, ColdFusion makes this data available in the action page,
as ColdFusion variables in the Form scope, with the naming convention
form.#GridName#.#ColumnName#
Each
returns these form variable(s):
SelectMode
SelectMode="single"
form.#GridName#.#ColumnName# = "SelectedCellValue"
SelectMode="column"
form.#GridName#.#ColumnName# = "ValueOfCellRow1,
ValueOfCellRow2, ValueOfCellRowN"
SelectMode="row"
form.#GridName#.#Column1Name# = "ValueOfCellInSelectedRow"
form.#GridName#.#Column2Name# = "ValueOfCellInSelectedRow"
form.#GridName#.#ColumnNName# = "ValueOfCellInSelectedRow"
Complex update data (SelectMode = Edit)
The grid returns a large amount of data, to inform the action page of inserts, updates or deletes
that the user made to the grid. In most cases, you can use the
gather the data from the form variables; the tag collects data, writes SQL calls, and updates the
data source.
If you cannot use
cfgridupdate
than one data source), you must write code to read form variables. In this mode, ColdFusion
creates the following array variables in the Form scope for each
form.#GridName#.#ColumnName#
form.#GridName#.original.#ColumnName#
form.#GridName#.RowStatus.Action
Each table row that contains an update, insert, or deletion has a parallel entry in each of these
arrays. To view all the information for all the changes, you can traverse the arrays, as in this
example:
<cfloop index="ColName" list="#ColNameList#">
<cfif IsDefined("form.#GridName#.#ColName#")>
<cfoutput><br>form.#GridName#.#ColName#:<br></cfoutput>
<cfset Array_New = evaluate("form.#GridName#.#ColName#")>
<cfset Array_Orig = evaluate("form.#GridName#.original.#ColName#")>
<cfset Array_Action = evaluate("form.#GridName#.RowStatus.Action")>
<cfif NOT IsArray(Array_New)>
<b>The form variable is not an array!</b><br>
<cfelse>
<cfset size = ArrayLen(Array_New)>
<cfoutput>
Result Array Size is #size#.<br>
Contents:<br>
</cfoutput>
<cfif size IS 0>
<b>The array is empty.</b><br>
<cfelse>
's action page contains information about
cfform
(if, for example, you must distribute the returned data to more
tag to automatically
cfgridupdate
:
cfgrid
cfgrid
157

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents