Dojo Enable Builder

 

The Dojo Enable Builder allows you to add Dojo capabilities to a page in your model. This builder provides the low level functionality of adding the proper JavaScript to bring in the dojo.js, and any specified dojo.require(...) packages on the target page. This builder is useful if you plan on manually adding Dojo functionality (such as widgets, I/O, or events) to a page in your model, or if you are creating your own Dojo Builder.

The following is an example of the JavaScript code that this builder adds to the page.

<script name="DojoEnable_script" language="JavaScript" src='<%= webAppAccess.getURLMapper().getStaticContentURL("/factory/dojo/dojo.js", request.getScheme()) %>'></script> <script name="DojoEnable_requires" language="JavaScript"> dojo.require("dojo.event.*"); dojo.require("dojo.io.*"); dojo.require("dojo.widget.*"); </script>

For more information on Dojo, visit http://dojotoolkit.org.

 

Specifying inputs

This builder takes the inputs described in the table below. For help on inputs common to many or all builders such as those in the Properties and HTML Attributes input groups, see Using the Builder Call Editor.

Input name Description
Name Enter a name for this builder call. The designer tool displays this name in the builder call list.
Select Page Select the page in your model to enable for Dojo. This is a required input. Example: page1.
Requires Package List Specify additional Dojo required packages to add to the generated JavaScript. For example if you specify dojo.widget.ComboBox in this list input, the following JavaScript statement will be added to the generated JavaScript on the target page.

dojo.require("dojo.widget.ComboBox");

(optional) JavaScript Specify any JavaScript code that you want to add to the target page. The code is placed in the same <script/> tag containing the Dojo requires statements. It is more efficient to place larger amounts of JavaScript is a separate .js file. Example:

dojo.addOnLoad(function() { dojo.lfx.html.fadeOut('fadeElm', 1000).play(); });

(optional) JavaScript Files Specify additional JavaScript files needed for the target page. Each file specified adds a new <script/> tag to the target page where the src attribute references the specified .js file. Example: /factory/dojo/src/fx/html.js