Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 868

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Note: You can bind to the display text of a select box, instead of the value, by specifying an attribute name of
Note: When you bind to a check box, use the
Internet Explorer when the user selects or deselects the check box, not when the box loses focus.
Grids and trees do not have default bind attributes.
• Always specify a grid target attribute by using the format {gridID.columnName
of the specified column in the selected row.
• For trees, you must bind to a specific node in the tree. Specify the node by using the node ID or an explicit path to
the node.
To bind to a Spry data set element or attribute, use standard Spry path notation. For example, specify an element name.
The event value
By default, the bind expression function executes each time the control specified in the bind parameter has an
event. To trigger updates on a different JavaScript event, end the bind expression with an at sign (@) and
onChange
the event name, without the "on" prefix. The following code, for example, executes the getChoices CFC each time the
user presses the mouse button while the pointer is over the
bind="cfc:myapp.bookorder.getChoices({inputForm:book@mousedown})"
Note: To bind to a
cfinput
event is the default event has no effect.
change
When you bind to a Spry data set, do not specify an event. The expression is evaluated when the selected row changes
in the data set, or when the data set reloads with new data.
You can also specify that a specific bind parameter never triggers bind expression reevaluation, by specifying
the event. This is useful, for example, if a bind expression uses multiple bind parameters binding to different form
fields, and you want the bind expression to trigger changes only when one of the fields changes, not when the others
change. In this case, you would specify
the bind. The following code shows this use:
bind="cfc:books.getinfo({iForm:book}, {iForm:author@none})"
The
event specifier is also useful when used with autosuggest text inputs, trees and grids, as follows:
@none
• When you use an autosuggest text input, the bind expression is evaluated as a user types in text, and picks up data
from all bind parameters, including those parameters with
for all bind parameters, because there is no way for it to react to changes in the parameters.
@none
• When you call the
ColdFusion.Grid.refresh
from all bind parameters when it evaluates the bind expression, including any parameters with
you specify
for all bind parameters, the tree or grid might not respond to changes in other controls, but gets
@none
data from all the bind parameters each time you explicitly refresh it.
Using CFC functions in bind expressions
As with JavaScript functions, you pass arguments to a CFC function specified in a bind expression positionally. When
you do this, the argument names in a CFC function definition do not have to be the same as the bind parameter names,
but the arguments in the bind expression must be in the same order as the arguments in the CFC function definition.
Alternatively, you pass named CFC function arguments. Then, the bind expression and CFC function must use the
same names for the arguments, and the function does not have to define the arguments in the same order as they are
passed. To specify argument names in a bind expression, use a format such as the following, which uses two named
parameters, arg1 and arg2:
event specifier to ensure that the bind expression is triggered in
@click
control with
attribute of
type
for the remaining fields, so events from those fields would not trigger
@none
or
ColdFusion.Tree.refresh
Last updated 1/20/2012
. The bind expression gets the value
}
control:
book
, specify a bind event setting, such as
button
specified. Therefore, for autosuggest, specify
@none
function, the function fetches data
863
.
innerHTML
. The
click
as
@none
specified. If
@none

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents