User Guide

Table Of Contents
Building Flash forms 695
</cfformgroup>
</cfformgroup>
<cfformgroup type="horizontal">
<cfinput type="submit" name="submit" width="100" value="Show Results">
<cfinput type="reset" name="reset" width="100" value="Reset Fields">
</cfformgroup>
</cfform>
Controlling sizes in Flash forms
Sizing elements in a Flash form is something of an art, rather than a science. As a general rule, if
you dont specify the
height and width attributes, Flash tends to do a good job of laying out the
form. However, keep in mind the following considerations:
If you do not specify the height and width attributes in the cfform tag, Flash reserves the full
dimensions of the visible browser window, if the form is not in a table, or the table cell, if the
form is in a table, even if they are not required for the form contents. Any HTML output that
precedes or follows the form causes the output page to exceed the size of the browser window.
If you do not specify the height or width of a control, including a form group, Flash adjusts the
dimensions, trying to fit the controls in the available space. For example, Flash often extends
input boxes to the width of the containing control, if not otherwise specified.
In general, it is best to use the following process when you design your Flash form.
To determine the sizes of a Flash form and its controls:
1.
When you first create the form, don’t specify any height and width attributes on the form or
its child tags. Run the form and examine the results to determine height and width values to use.
2.
Specify height and width attributes in the cfform tag for the desired dimensions of the form.
You can specify absolute pixel values, or percentage values relative to the size of the containing
window.
3.
Specify any height or width attributes on individual tags. These values must be in pixels.
4.
Repeat step 3 for various tags, and possibly step 2, until your form has a pleasing appearance.
Repeating Flash form elements based on query data
The
repeater cfformgroup type tells Flash Player to iterate over a query and create a set of the
cfformgroup tag’s child controls for each row in the query. For each set of child controls, bind
attributes in the child tags can access fields in the current query row. This
cfformgroup type lets
you create Flash forms where the number of controls can change based on a query, without
requiring ColdFusion to recompile the Flash SWF file for the form. This significantly enhances
server performance.
Note: For more information on binding data, see “Binding data in Flash forms” on page 699.
Optionally, you can specify a start row and a maximum number of rows to use in the repeater.
Unlike most ColdFusion tags,
cfrepeater index values start at 0, not 1. To specify a repeater
that starts on the first line of the query object and uses no more than 15 rows, use a tag such as the
following:
<cfformgroup type="repeater" query="q1" startrow="0" maxrows="15">