Chapter 10: Building Dynamic Forms
<CFAPPLET APPLETSOURCE="myapplet"
NAME="applet1_var"
HEIGHT=400
WIDTH=200
VSPACE=125
HSPACE=125
ALIGN="left">
Overriding parameter values
You can also override the values you assigned to applet parameters in the
Administrator by providing new values for any parameter. Note that in order to
override a parameter, you must have already defined the parameter and a default value
for it in the ColdFusion Administrator Applets page.
<CFAPPLET APPLETSOURCE="myapplet"
NAME="applet1_var"
Param1="registered parameter"
Param2="registered parameter">
Handling form variables from an applet
The CFAPPLET tag requires you to specify a form variable name for the applet. This
variable, referenced like other ColdFusion form variables,
holds the value the applet method provides when it is executed in the CFFORM.
Not all Java applets return values. Some, like many graphical widgets, do not return a
specific value; they do their flipping, spinning, fading, exploding, and that's that. For
this kind of applet, the method field in the Administrator remains empty. Other
applets, however, do have a method that returns a value. You can only use one method
for each applet you register. If an applet includes more than one method that you want
to access, you can register the applet with a unique name an additional time for each
method you want to use.
To reference a Java applet return value in your application page:
1.
Specify the name of the method in the Register New Applet page of the ColdFusion
Administrator.
2.
Specify the method name in the NAME attribute of the CFAPPLET tag when you
code your CFFORM.
When your page executes the applet, a form variable is created with the name you
specified. If you don't specify a method, no form variable is created.
form.
variable_name
147
Need help?
Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?
Questions and answers