User Guide

Table Of Contents
656 Chapter 27: Building Dynamic Forms with cfform Tags
Registering a Java applet
Before you can use a Java applet in your ColdFusion pages, you must register the applet in the
ColdFusion MX Administrator.
To register a Java applet:
1.
Open the ColdFusion MX Administrator by clicking the Administrator icon in the
Macromedia ColdFusion MX Program group and entering the Administrator password.
2.
Under Extensions, click Java Applets.
The Java Applets page appears.
3.
Click the Register New Applet button.
The Add/Edit Applet page appears.
4.
Enter options in the applet registration fields, as described in the ColdFusion MX
Administrator online help. Use the Add button to add parameters.
5.
Click Submit.
Using the cfapplet tag to embed an applet
After you register an applet, you can use the
cfapplet tag to place the applet in a ColdFusion
page. The
cfapplet tag has two required attributes: appletsource and name. Because you
registered the applet and you defined each applet parameter with a default value, you can invoke
the applet with a very simple form of the
cfapplet tag:
<cfapplet appletSource="appletname" name="form_variable">
Overriding alignment and positioning values
To override any of the values defined in the ColdFusion MX Administrator for the applet, you
can use the optional
cfapplet parameters to specify custom values. For example, the following
cfapplet tag specifies custom spacing and alignment values:
<cfapplet appletSource="myapplet"
name="applet1_var"
height=400
width=200
vspace=125
hspace=125
align="left">
Overriding parameter values
You can override the values that you assigned to applet parameters in the ColdFusion MX
Administrator by providing new values for any parameter. To override a parameter, you must have
already defined the parameter and its default value in the ColdFusion MX Administrator Applets
page. The following example overrides the default values of two parameters, Param1 and Param2:
<cfapplet appletSource="myapplet"
name="applet1_var"
Param1="registered parameter1"
Param2="registered parameter2">