JavaScript Interface

User-defined JavaScript functions can be attached to individual fields on each add or edit screen within ExtraView. The JavaScript functions are not restricted in scope. This powerful feature allows you to generate virtually any functionality within an add or edit screen. Some typical uses of this feature are:

  • Generate simple or complex data checking functions that are triggered upon selecting or editing an individual field
  • The functions can refer to multiple fields on the form, thus allowing you to check for specific combinations of data. E.g. you may want to check the value of a field entered, according to the specific Product selected, one of two Statuses selected, and the Assigned To for the issue
  • Alter the requiredness of a field or fields
  • Alter the visibility of a field or fields
  • Provide mathematical computation between fields on a form, within the browser and without using a business rule executed on the server
  • Override the inbuilt ExtraView JavaScript functions

To accomplish the setting up of a user-defined JavaScript function, first note that each ExtraView form generated contains the following statements:

<SCRIPT LANGUAGE="JavaScript" SRC="xxxxxxx/user_javascript/UserJavaScript.js">
</SCRIPT>

where xxxxxxx is the environment name. This permits the programmer to reference a custom JavaScript library.

Note: Browsers do not generate an error if the UserJavaScript.js file does not exist. This gives transparent functionality if no user-defined functions exist.

Note: This directory exists within the web server, not the application server directory tree.