I am working on upgrading a web app from dojo 1.5 to 1.8 (or 1.7.3). This app has several custom templated widgets that inherit from dijit.Dialog. I am finding that these don’t render correctly at all. For an example, see http://jsfiddle.net/tinyels/XhrWF/1/
If you set it to dojo 1.5 or 1.6 it lays out correctly. In 1.7, it won’t even show(). In 1.8, various attachpoints are missing and buttons don’t work. Inspecting it in a debugger shows that it only has the some attachpoints (titleBar, titleNode, closeButtonNode, closeText, containerNode, gridContainer) and is missing several such as btnGo.
What changes do I need to make to the widget (or it’s template) to get it to work in newer versions of Dojo?
I think that
widgetsInTemplatedoes not work anymore in Dojo 1.7+. Your template is not parsed at all. You can manually calldojo.parser.parse(this.containerNode)(e.g. inpostCreate), but you will be missingdojoAttachPointanddojoAttachEventgenerated references.The Dojo 1.7+ way of having widgets in a template is to subclass
dijit/_WidgetsInTemplateMixin, in your case:and all should work as before. Try it at jsFiddle: http://jsfiddle.net/phusick/UEXmF/