Adobe COLDFUSION 9 Manual page 786

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Note: You do not use the text property (for example,
use the format
.
formname
Custom ActionScript functions
Custom ActionScript functions are the equivalent of CFML UDFs. You can define your own functions in ColdFusion
by using the
tag with a
cfformitem
(.as) file. Also, ColdFusion includes a small number of predefined custom ActionScript functions that you can use in
your Flash form controls.
You can use the following custom functions in the ActionScript for all form controls to reset or submit the form:
resetForm()
submitForm()
You can use the following custom functions in
gridName
GridData.insertRow(
gridName
GridData.deleteRow(
The following example shows how you can use the two GridData functions to add custom buttons that add and delete
rows from a Flash form. These buttons are equivalent to the buttons that ColdFusion creates if you specify
and
insert="yes"
delete="yes"
placement. This example puts the buttons on the side of the grid, instead of below it and uses longer than standard
button labels.
<cfform format="flash" height="265" width="400">
<cfformitem type="html">
You can edit this grid as follows:
<ul>
<li>To change an item, click the field and type.</li>
<li>To add a row, click the Insert Row button and type in the fields
in the highlighted row.</li>
<li>To delete a row, click anywhere in the row and click the
Delete Row button</li>
</ul>
<p><b>When you are done, click the submit button.</b></p>
</cfformitem>
<!--- The hbox aligns the grid and the button vbox horizontally --->
<cfformgroup type="hbox" style="verticalAlign:bottom;
horizontalAlign:center">
<!--- To make all elements align properly, all of the hbox children must
be containers, so we must put the cfgrid tag in a vbox tag. --->
<cfformgroup type="vbox">
<!-- An editable grid with hard coded data (for simplicity).
By default, this grid does not have insert or delete buttons. --->
<cfgrid name="mygrid" height="120" width="250" selectmode="edit">
<cfgridcolumn name="city">
<cfgridcolumn name="state">
<cfgridrow data="Rockville,MD">
<cfgridrow data="Washington,DC">
<cfgridrow data="Arlington,VA">
</cfgrid>
</cfformgroup>
<!--- Group the Insert and Delete buttons vertically;
use a vbox to ensure correct alignment. --->
fieldname
= '
.
fieldname
value'
attribute value of
type
tags only to insert and delete rows in the grid:
cfgrid
)
)
in the
tag, but they allow you to specify you own button text and
cfgrid
Last updated 8/5/2010
.
) to access hidden fields. To access a hidden field,
text
or you can define the functions in an ActionScript
script,
781

Advertisement

Table of Contents
loading

Table of Contents