I’ve added a Toaster div using:
<div dojoType="dojox.widget.Toaster" duration="0" messageTopic="myMessages" positionDirection="tr-right" id="toasted"></div>
I’ve added the require:
dojo.require("dojox.widget.Toaster");
and the CSS for the theme and also for the Toaster:
dojo-release-1.6.0/dojox/widget/Toaster/Toaster.css
http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css
Upon a click event I’ve added a message to publish:
dojo.addOnLoad(function() {
dojo.connect(dojo.byId('strapline'), 'onclick', function(event) {
dojo.publish('myMessages', [{ message: 'Qwerty', type: "error", duration: 0}])
});
});
Can you see where I’m going wrong?
There’s a few things you can check:
Paths: do all the resources have correct urls and actually load? Firebug or similar browser console should be able to tell you this
parseOnLoad: By default, the parser is not loaded and doesn’t run, so if your declarative widget there won’t be instantiated unless you have set dojo.config.parseOnLoad to true. See this dojo config tutorial for more details.
Add theme class to the BODY. E.g. class=”claro”
I plugged this in to a test page and it all worked for me: http://jsfiddle.net/sfoster/u3TLg/