Integrating JavaScript and Oracle Forms
This section describes an example for integrating JavaScript in Oracle Forms application.
To build a Forms application using JavaScript events, see:
- About Oracle Forms Calling External Events
- About JavaScript Events Calling into Oracle Forms
- Also refer Forms Builder Online Help
To integrate JavaScript in Oracle Forms applications:
- Build a Forms application using the JavaScript events. Use the
:system.javascript_event_name
and:system.javascript_event_value
in theWHEN-CUSTOM-JAVASCRIPT-EVENT
trigger. Compile the module. - Create an html file (for example,
test.html
) that the Forms servlet will use as a template when generating the HTML page used to start an Oracle Forms application. Copy the file to the Forms configuration directory:$ORACLE_INSTANCE/config/FormsComponent/forms/server
- Copy any required images, html files, JavaScript files, and css files to the following directory:
$DOMAIN_HOME/servers/WLS_FORMS/tmp/_WL_user/formsapp_14.1.2/<random_string2>/war/
- Create an html file that uses the JavaScripts (for example,
js.html
) and invokes the servlet URL. - Using Enterprise Manager, create a new configuration section or modify an existing one and enable
enableJavascriptEvent
. Set baseHTMLjpi totest.html
. - Using Enterprise Manager, edit the
default.env
file and add the directory where you saved the forms application to the environment variableFORMS_PATH
. - Run the application by using the URL in your browser:
http://<localhost>:9001/forms/js.html