Opened 8 years ago

Closed 8 years ago

#13426 closed defect (fixed)

dojox/dtl/demos broken in 1.7

Reported by: Chris Mitchell Owned by: Neil Roberts
Priority: high Milestone: 1.7
Component: DojoX DTL Version: 1.7.0b1
Keywords: Cc: Ed Chatelain, ben hockey
Blocked By: Blocking:

Description

Running any of the dojox/dtl/demos in a browser results in: "load" is not a function

Attachments (1)

dtl-13426Patch (8.0 KB) - added by Ed Chatelain 8 years ago.
These updates are described in the comments, if someone could take a look at them and commit them if they look ok, I would appreciate it.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 8 years ago by Chris Mitchell

Cc: Ed Chatelain added
Keywords: ed.chatelain@gmail.com removed

comment:2 Changed 8 years ago by Ed Chatelain

It looks like many of the demos are missing: dojo.require("dijit._Widget");

And some also need to remove the comments around: {% load dojox.dtl.contrib.dijit %} It looks like the load was commented out with this comment, but maybe that is no longer the case? Note, the load tag here is superfluous, since _DomTemplate has a dojo.require for it.

I will try to create a patch tomorrow, there is still 3 failing after the above changes, which I need to work on demo_Templated.html, and demo_Table.html and demo_Data.html

comment:3 Changed 8 years ago by ben hockey

Cc: ben hockey added

comment:4 Changed 8 years ago by Ed Chatelain

While working on the dtl/demos I found the following problems with the dtl code. dojox.dtl._base.js - was missing define for "dojo/_base/Deferred", and had to change xhr.xhrGet() to xhr.get() dojox.dtl._DomTemplated.js - had to change cache.cache() to cache(). dojox.dtl._Templated.js - had to define dijit/_TemplatedMixin instead of dijit/_Templated, and had to add a function to the call to attachTempalteNodes. dojox.dtl.contrib.dom.js - change from domStyle.style() to domStyle.set().

And I made the following updates to the demos: dojox/dtl/demos/demo_Data.html - was missing a dojo.require for dijit._Widget. dojox/dtl/demos/demo_Table.html - was missing a dojo.require for dijit._Widget. dojox/dtl/demos/demo_Templated.html - was missing a dojo.require for dijit._Widget.

dojox/dtl/demos/templates/blog_base.html, blog_list.html and blog_page.html - had to remove the <!-- --> from around this line: {% load dojox.dtl.contrib.dom %} But I am not sure why this was necessary, it worked in 1.6 with the <!-- --> around it...

I will attach the patch with these updates.

Changed 8 years ago by Ed Chatelain

Attachment: dtl-13426Patch added

These updates are described in the comments, if someone could take a look at them and commit them if they look ok, I would appreciate it.

comment:5 Changed 8 years ago by Adam Peller

wondering if _WidgetBase should be used instead of _Widget, also whether there's some loader routine hanging off require which could replace the dojo.cache

comment:6 Changed 8 years ago by Ed Chatelain

how about changing _Widget to _WidgetBase and then apply the patch and we can consider replacing dojo.cache after the beta is built?

comment:7 Changed 8 years ago by Adam Peller

In [26213]:

Remove deprecated code, update getObject calls, use dijit._WidgertBase instead of dijit._Widget and other AMD refactoring. refs #13426 \!strict

comment:8 Changed 8 years ago by Ed Chatelain

Hi Adam,

Thanks for committing my patch and for making the other updates to dtl.

I found one problem with the updates to dtl/_base which are causing a few test failures for things which were working ok with just my patch. The change you made in the get: function(key, otherwise) You changed:

if(typeof this[key] != "undefined"){

return n(this[key]);

}

To this:

if(this[key] != undefined){

return n(this[key]);

}

The problem is happening when this[key] is null, and the typeof this[key] is an object, the old test would pass (and return n(this[key])) , but your test is failing and going on to the return otherwise; So you can either change back to the typeof or change to also allow null. Thanks, Ed

comment:9 Changed 8 years ago by Adam Peller

In [26218]:

Why I shouldn't do checkins while on vacation. Refs #13426 \!strict

comment:10 Changed 8 years ago by Adam Peller

Yah, my bad. Hadn't written a line of code in over a week :)

comment:11 Changed 8 years ago by bill

Ed, is this ticket good to close? I image there are a lot of DTL issues but as far as what this ticket is meant to cover.

comment:12 Changed 8 years ago by Ed Chatelain

Yes this ticket can be closed, the demos and the tests are running successfully now. I want to do some async testing, but any updates for that can be done on the dojox amd ticket 12863.

comment:13 Changed 8 years ago by Adam Peller

Resolution: fixed
Status: newclosed

the cache thing should be investigated, but that too could go under #12863

Note: See TracTickets for help on using tickets.