
785
DEVELOPING
COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Las
t
upda
te
d 8/5/2010
Example: a simple skinnable form
The following image shows a simple XML skinnable form that uses the default skin to format the output:
This form is used in the examples and description.
Building XML skinnable forms
You build ColdFusion XML skinnable forms using standard ColdFusion forms tags, including
cfformgroup
and
cfformitem
tags. These tags create the
elements
of the form, the building blocks of the form.
ColdFusion converts the following tags to XML for processing by the XSLT:
Standard ColdFusion form data control tags
The
cfgrid
,
cfinput
,
cfselect
,
cfslider
,
cftextarea
, and
tree
tags specify the controls that the form displays.
cfformitem tags
Add individual items to your form, such as text or rules. The valid types depend on the skin.
cfformgroup tags
Group, organize, and structure the form contents. The valid types depend on the skin.
These tags are designed so you can develop forms in a hierarchical structure of
containers
and
children
. Using this
model, the
cfform
tag is the master container, and its contents are
children
containers and controls. Each
cfformgroup
tag defines a container that organizes its child elements.
The specific tags and attributes that you use in your form depend on the capabilities of the XSLT skin. You use only
the tag and attribute combinations that the skin supports. If you are using a skin provided by a third party, make sure
that the supplier provides information on the supported attributes.
Using standard ColdFusion form tags
You use standard ColdFusion form tags, such as
cfinput
or
cftree
, as you normally do in standard CFML forms to
generate form input elements. ColdFusion maps most of these tags and their subtags (such as
option
tags in the
cfselect
tag) to equivalent XForms elements. ColdFusion maps applet and Flash format
cfgrid
and
cftree
tags to
ColdFusion XML extensions that contain Java applet or Flash objects. It converts XML format
cfgrid
and
cftree
tags to ColdFusion XML extension.
The specific attributes you can use and their meanings can depend on the skins.
Using ColdFusion skins:
The skins that are supplied with ColdFusion support the attributes that you can use with
HTML forms. You can also use
label
attributes to provide labels for the following tags:
•
cfinput
with
type
attribute values of
text
,
button
,
password
, and
file