General Interface is an open source project hosted by the Dojo Foundation

Loading and Deploying Dojo

Use the General Interface class jsx3.util.Dojo to load the Dojo Toolkit in your General Interface application.

jsx3.require("jsx3.util.Dojo");
jsx3.util.Dojo.load();
Not all binary distributions of General Interface include Dojo. Dojo.load() will load Dojo only if the necessary files are present in the General Interface installation directory.

Dojo widget integration with jsx3.gui.DojoWidget requires that the Dojo Toolkit be loaded. jsx3.gui.DojoWidget calls Dojo.load(), so you usually do not need to call this method explicitly. However, you may want to load the Dojo Toolkit even if you are not using Dojo widgets, as in the following example.

jsx3.require("jsx3.util.Dojo");
jsx3.util.Dojo.load();
dojo.query("p").fadeOut();

Installing the Dojo Toolkit

Some binary distributions of General Interface include a pre-built version of Dojo. General Interface assumes that Dojo will be installed in the standard directory dojo_toolkit/ contained in the General Interface installation directory, although this location can be overridden. The contents of this directory would typically be dojo/, dojox/ and dijit/.

Dojo can be added to any General Interface build. Dojo itself is available in many pre-built varieties and as a source distribution. To add Dojo to General Interface,

  1. Download any version of Dojo from http://www.dojotoolkit.org
  2. Optionally, create a customized build of Dojo with the Dojo build scripts
  3. Place Dojo in the dojo_toolkit/ directory inside the General Interface installation directory.

You can also replace the Dojo build included in a General Interface distribution with a custom Dojo build using the same steps.

General Interface requires Dojo 1.4, which is still in development as of the release date of General Interface 3.8. Until Dojo 1.4 is released use a nightly build or a Subversion snapshot of Dojo.

After these steps are completed, the General Interface classes jsx3.util.Dojo and jsx3.gui.DojoWidget will function properly.

After installing Dojo the Dojo widget prototypes may not show up in the Component Libraries palette in Builder. To install these prototypes copy the directory GI_Builder/prototypes/Dojo from the source distribution of General Interface.

Deploying and Loading Dojo

If your General Interface application uses Dojo, for example by including an instance of jsx3.gui.DojoWidget in a component file, you must deploy the Dojo directory along with the rest of the General Interface deployment files. Copy dojo_toolkit/ to the deployment location. It should be in the same directory as JSX/.

You may override the default location (dojo_toolkit/) where General Interface looks for Dojo. To do this set the jsx_dojo deployment parameter to the relative path from the application launch page to the Dojo directory. For example:

<script type="text/javascript" src="JSX/js/JSX30.js"
    jsxapppath="JSXAPPS/myApp"
    jsx_dojo="../path/to/dojo">
</script>

Alternatively, you can load the Dojo toolkit by adding a script tag in the HTML head of the application launch page. The src attribute of the script tag should be the location of dojo.js.

<head>
    <script type="text/javascript" src="dojo-toolkit/dojo/dojo.js"></script>
</head>

Contents

Searching General Interface Docs

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.