Embedding Java Applets - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

144
To populate a drop-down list box with query data using CFSELECT:
1.
Open a new file in Studio.
2.
Modify the file so that it appears as follows:
<CFQUERY NAME="getNames"
</CFQUERY>
<CFFORM NAME="Form1" ACTION="submit.cfm"
</CFFORM>
3.
Save the file as
Note that because the MULTIPLE attribute is used, the user can select multiple entries
in the select box. Also, because the VALUE tag specifies the primary key for the
Employee table, this data is used in the form variable that is passed to the application
page specified in ACTION.

Embedding Java Applets

The CFAPPLET tag allows you to embed Java applets in a CFFORM. To use CFAPPLET,
you must first register your Java applet using the ColdFusion Administrator Applets
page. In the Administrator, you define the interface to the applet, encapsulating it so
that each invocation of the CFAPPLET tag is very simple.
CFAPPLET offers several advantages over using the HTML APPLET tag:
Return values — Since CFAPPLET requires a form field name attribute, you can
avoid having to code additional JavaScript to capture the applet's return values.
You can reference return values like any other ColdFusion form variable:
form.variablename
Ease of use — Since the applet's interface is defined in the Administrator, each
instance of the CFAPPLET tag in your pages only needs to reference the applet's
name and specify a form variable name.
DATASOURCE="CompanyInfo">
SELECT * FROM Employees
METHOD="Post">
<CFSELECT NAME="employeeNames"
QUERY="getNames"
VALUE="Employee_ID"
DISPLAY="FirstName"
REQUIRED="yes"
MULTIPLE="yes"
SIZE="8">
</CFSELECT>
<BR><INPUT TYPE="Submit"
VALUE="Submit">
selectbox.cfm
.
Developing Web Applications with ColdFusion
and view it in your browser.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion 4.5

Table of Contents