Extending the Rich UI widget set with Dojo widgets

You can write widgets that are based on the Dojo Toolkit, a popular JavaScript™ library that is described at http://dojotoolkit.org.
We provide a sample named dojo, which includes the following four files:

Notice that DojoSample.egl, the code written for interacting with the new widget, is all-but identical to the code written to interact with the Rich UI button in the buttontest sample (file OneButton.egl); the APIs are the same, for ease of use by the EGL developer.

You can place the files Button.egl, Button.js, and dojo.html in a standalone project and store that project in a repository so that others in your organization can use the Dojo functionality without their needing to maintain duplicate JavaScript implementations. Also, you can expose additional DoJo widgets to EGL developers; for example, by coding Tree.egl and Tree.js to provide the Dojo Tree widget.

As shown in the sample, you need to be aware of an unusual requirement when you create widgets with Dojo. When any Rich UI application is running, a hierarchy of EGL widgets is in memory, and each widget refers to one or more nodes of the document object model (DOM). The difference when you work with Dojo is that you first replace native DOM elements with nodes that are specific to Dojo and then ensure that the EGL widgets refer to those nodes.


Feedback