Client Script Configuration
Dialog
See also: Working With Web Resources, Rich Client Features
Client Scripts, once created, must then be associated with a page before they can be used. Client Scripts can be associated with a Page directly, with a Form, or with a Presentation Template. The form inherits any Client Script associations from the presentation template (if the form is linked to one) and the page, in turn, inherits any Client Script associations from its owning form.
This dialog is available in the Web Resources Section for each of these entities. Its job is to allow Client Scripts to be added, allow associations to be made with scripts which are hosted outside of Ebase (referred to as External Scripts) and to manage any inherited associations.
Only those Client Script associations which apply to the entity which opens the dialog are shown. The picture above shows the dialog opened from Page Properties, so page, form and template associations are shown. When opened via Form Properties, only Client Scripts for that form and any inherited from a template would be shown. Presentation Template cannot inherit from anywhere else so only Client Scripts associated with it will be shown.
Client Scripts are included in a web page using <script> tags. These tags are generated in the order that the Client Scripts appear in this dialog. They can be moved up or down by clicking on the appropriate buttons, but are always ordered in the following way: presentation template scripts, then form scripts, then page scripts. The ordering of inherited Client Scripts cannot be changed. The relative order of Clients Scripts is important as functions and code declared in one script can only use code and functions declared in scripts that come before it.
This dialog shows both Client Script associations as well as
any External Script associations (see below).
Property |
Description |
Apply |
Click this checkbox to indicate that the Client Script should be applied. If a Client Script association is disabled (not applied) then it will not be inherited. |
Name |
Name of the Client Script / External Script – this is read only. |
From |
Shows the level at which the Client Script was configured, and is for information only. Client Scripts inherited from higher levels can be disabled by unchecking the Apply checkbox but they cannot be removed. |
Any existing Client Script can be added by selecting it from the list, but the same script cannot be added more than once.
An External Script is a script that is hosted outside of Ebase but is accessible to the users of the web site. A common use of External Scripts is to add libraries that Client Scripts can then use. In the picture above we are adding a JQuery library (which is itself a piece of JavaScript) and by doing so we can use the APIs JQuery provides in other Client Scripts we add. The ordering is important, as Scripts (and Client Scripts) can only use code and functions declared in scripts that come before it. For example if a Client Script wishes to make use of functions from the JQuery library, that Client Script must be ordered so it appears below (after) the association to the JQuery library (see Configuration Dialog above).
Property |
Description |
Name |
This is name assigned by you to describe the External Script you are adding. It serves no other purpose other than to act as an identifier in the Configuration Dialog. |
URL Path |
The path to the script being added. Can be absolute (e.g. http://www.mydomain.somejavascript.js) or relative to the root of the Ebase Xi web application (e.g. somejavascript.js). Can contain field names and other variables prefixed by && as part or all of the content. These variables are then dynamically evaluated at runtime and substituted into the path string. Field variables and environment variables can be specified, e.g. &&URL_PATH |
Content Type |
The type of script being added: usually this will be JavaScript, but any type of script is allowed. However, you must ensure that your target browsers understand other script types. |
Charset |
The character encoding used in this script: usually ISO-8859-1 or UTF-8. |