Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 867

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
{[formName:]controlName[.attributeName][@event]}
{SpryDataSetName.fieldName}
The brackets ([]) indicate optional contents and are not part of the parameter.
Note: To include a literal brace character in a bind expression, escape the character with a backslash, as \{, \}.
The formname value
The formname entry identifies the form that contains the control you are binding to. Specify a form name if multiple
forms contain bind targets with the same names. To specify the form name, start the bind expression with the form's
attribute the
attribute if you did not specify an
id
name
control that is in a form named
bind="cfc:myapp.bookorder.getChoices({inputForm:book})"
The controlName value
To bind to a form field, the controlName value must be the value of the
which you are binding. If a control has both an
You can bind to any ColdFusion form control, including
ColdFusion tags, such as
cftable
To bind to a Spry data set, specify the data set name in this part of the bind parameter.
You can bind to multiple radio buttons or check boxes by giving them the same
a radio button group have the same
boxes have the same
value, the bind parameter represents the values of the selected controls in a comma-
name
delimited list. If you also specify a unique
for each button or check box and use the
label, not just the button or box.
If a
control supports multiple selections, the bind expression returns the information about the selected
cfselect
items in a comma-delimited list.
You can bind only to controls that are available in the DOM tree when the bind is registered. Binds are registered when
the page with the bind expression loads, either in the browser window or in a container tag. As a result, if you have two
,
,
cfdiv
cflayoutarea
cfpod
attribute, you cannot bind controls in one container to controls in the other, because one container cannot be assured
that the other is loaded when it loads. Similarly, elements on the main page cannot bind to elements on a dynamically
loaded container. To prevent this problem, define the bind target in line on the main page, instead of using a
or
attribute to retrieve the markup that contains the bind target. In other words, the "master" form with fields
bind
that serve as sources of bind expressions is loaded statically (on the main page), and the "child" controls that depend
on the data are loaded dynamically, on a page that is specified in a
The attributeName value
When you bind to a form control, by default, the bind expression represents the
control. If the bind target is a
selected items.
To bind to a different attribute, follow the control
attribute of a checkbox
checked
following:
bind="cfc:myapp.bookorder.useStatus({myForm:approved.checked@click})
id
, for example, use the following format:
inputForm
and a
id
name
.
value, the bind parameter represents the selected button. If multiple check
name
attribute for each check box or radio button, specify an HTML
id
value in the
id
for
, or
containers that you load by using a
cfwindow
tag, the bind expression represents a comma delimited list of the values of the
cfselect
or
name
tag as a CFC parameter, for example, use an expression such as the
cfinput
Last updated 1/20/2012
attribute, and follow it with a colon (:). To specify the
or
attribute of the form control to
id
name
attribute, use either value.
and
. You cannot bind to values in other
cfgrid
cftree
value. If all the radio buttons in
name
attribute; in this case, users select items by clicking the
source
or
attribute.
source
bind
value
with a period (.) and the attribute name. To pass the
id
book
tag
label
(or for
tag,
)
cfdiv
bind
source
attribute of the specified
862

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents