Subversion Repositories Applications.papyrus

Rev

Blame | Last modification | View Log | RSS feed

Changes from Dojo 0.4 dojo.widgets to new dijit project
=======================================================

The widgets and widget infrastructure have been separated into separate project,
vastly streamlined and with a new directory structure.   There are many other changes.

Markup
------

dojoType="button" replaced by dojoType="dijit.Button"  Must use fully qualified class name,
and it's case-sensitive.

Need to manually dojo.require("dojo.parser") to get parsing

Widget namespaces and widget auto-loading are desupported.

onClick="foo" now overrides (ie, replaces) the default onClick() function rather than attaching to it,
so widget designers should make empty onClick() functions (when appropriate).

Programmatic creation
---------------------
Create widgets via

        new dijit.Button(params, srcNodeRef)

createWidget() call removed since multiple renderers are no longer supported (see next section).

At least for the dijit widgets, all widgets are guaranteed to work programmatically, which in
effect means that all widgets must have templates, unless the default <div> works.

Renderers
---------
Removed support for multiple renderers (svg & vml & a11y) for a single widget.
If a widget wants to render differently on different platforms, there must be
branching code inside the widget, or it needs to call a library that branches
based on the browser type (like dojo.gfx or dojo.charting).


Templates
---------
"this." is no longer used within ${} substitution notation.  See ticket #2905.
dojoRoot,buildScriptBase,dojoModuleUrl are no longer supported, but
any JavaScript properties on the widget's 'this' may be referenced with dotted notation.
The attributes dojoOn* are desupported (including dojoOnBuild);
also can't use id attribute to affect a dojoAttachPoint.

dojoAttachEvent is case sensitive, so capitalization matters.   You will probably have
to change

dojoAttachEvent="onClick"

to

dojoAttachEvent="onclick: onClick"

(given that the event name is lowercase, and assuming that the method name is camel case)

lists within dojoAttachPoint, dojoAttachEvent, waiRole, and waiState are now comma-separated
(not separated by semi-colons)

Standard HTML attributes like 'id', 'name', 'lang', etc. are carried over programmatically
by the _Widget constructor and do not need to be declared in the template (see _Widget.attributeMap)

Parent/Child relationships
--------------------------
By default widgets exist as islands, not knowing about their parent widget or children widgets.
The exception is the destroy() function which will also delete all descendant widgets.
Some widgets like Tree and SplitContainer will know about their children, but those widgets
will use the special mixins in Container.js / Layout.js. 

Widget.js base class
--------------------

 - Widget.js, Domwidget.js, HtmlWidget.js combined into dijit.base.Widget, with TemplatedWidget mixin
for widgets with templates

 - on widget creation, postMixInProperties(), buildRendering() and postCreate() is called.
 fillInTemplate() is no longer called.  In addition, those functions call signatures have changed.
 No arguments are passed.  To get the source dom Node, just reference this.srcDomNode.
When postCreate() is called the widget children don't yet exist.

 - The TemplatedWidget mixin defines buildRendering().  widgetsInTemplate not ported yet.

 - onResized() removed

 - the whole parent/child relationship thing is gone

 - extraArgs[] is gone

 - postCreate() called but child widgets don't exist yet

 - templateCssPath ignored.   User must manually include tundra.css file