User Guide
Chapter 10: Building Dynamic Forms 135
Code Review
Specifying which tree items to send to the action page
When a user selects a tree item and submits the form, the CFTREEITEMKEY variable is
appended to the URL passed to the application page specified in the CFFORM
ACTION attribute, in the form:
http://myserver.com?CFTREEITEMKEY=selected_value
You can disable this key by setting the APPENDKEY attribute in the CFTREE tag to No.
Creating Data Grids with CFGRID
The CFGRID tag allows you to build CFFORM grid controls. A grid control resembles a
spreadsheet table and can contain data populated from a CFQUERY or from other
sources of data. As with other CFFORM tags, CFGRID offers a wide range of data
formatting options as well as the option of validating user selections with a JavaScript
validation script.
You can also do the following with CFGRID:
• Sort data in the grid alphanumerically
• Update , insert and delete data
• Embed images in the grid
When users select grid data and submit the form, ColdFusion passes the selection
information as form variables to the application page specified in the CFFORM
ACTION attribute.
Just as the CFTREE tag uses CFTREEITEM, CFGRID uses the CFGRIDCOLUMN tag.
You define a wide range of row and column formatting options, as well as a query
name, selection options, and so on. You use the CFGRIDCOLUMN tag to define
individual columns in the grid.
Code Description
HREF="http://www.allaire.com">
Make the node of the tree a link.
HREF="http://forums.allaire.com"
Make the node of the tree a link.
Note HREF can refer to the name of
a column in a query if the tree item
is populated from that query.