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:

To integrate JavaScript in Oracle Forms applications:

  1. Build a Forms application using the JavaScript events. Use the :system.javascript_event_name and :system.javascript_event_value in the WHEN-CUSTOM-JAVASCRIPT-EVENT trigger. Compile the module.
  2. 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
  3. 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/
  4. Create an html file that uses the JavaScripts (for example, js.html) and invokes the servlet URL.
  5. Using Enterprise Manager, create a new configuration section or modify an existing one and enable enableJavascriptEvent. Set baseHTMLjpi to test.html.
  6. Using Enterprise Manager, edit the default.env file and add the directory where you saved the forms application to the environment variable FORMS_PATH.
  7. Run the application by using the URL in your browser: http://<localhost>:9001/forms/js.html