Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10526 closed defect (fixed)

dojox.dtl._Templated widget throws 'this._attachPoints has no properties' error

Reported by: James Cantwell Owned by: bill
Priority: high Milestone: 1.4.1
Component: DojoX DTL Version: 1.4.0b
Keywords: dtl Cc:
Blocked By: Blocking:


This is the first dojo ticket I've created so apologies if I've missed out on adding any necessary information. I have a widget that extends dojox.dtl._Templated where the template contains some widgets with a dojoattachPoint attribute specified. This was working in 1.3.2 as far as I remember but it now throws an error 'this._attachPoints has no properties' in 1.4rc2. Below is a stripped down test case that produces the error

dojo.declare("views.users.UserEdit", [ dijit._Widget, dojox.dtl._Templated ],
   templateString: dojo.cache("views.templates.users","userEditorPage.html"),
   widgetsInTemplate: true,
   userEditorTitle: "Edit User",

   constructor: function(args)
      console.log("views.user.UserEdit constructor.");
      dojo.mixin(this, args);


   <div class="top-level-header">{{userEditorTitle}}</div>
   <div dojoType="dijit.form.Form" dojoAttachPoint="userEditorForm">

Attachments (2)

_Templated.patch (443 bytes) - added by ID 12 years ago.
dijit._Templated.patch (775 bytes) - added by ID 12 years ago.
Real patch

Download all attachments as: .zip

Change History (9)

comment:1 Changed 12 years ago by bill

Component: GeneralDojoX DTL
Owner: changed from anonymous to Neil Roberts

Probably a dup of #10014, not sure.

Changed 12 years ago by ID

Attachment: _Templated.patch added

comment:2 Changed 12 years ago by ID

I tried #10014 patch but I won't fix this issue. However this small patch did the trick.

comment:3 Changed 12 years ago by Daniel Stefaniuk

IMO this is not the dojox.dtl._Templated issue. The problem is related to dijit._Templated. The protected property _attachPoints isn't declared in the dijit._Templated class. The first occurrence is in line 78 of buildRendering method and of course this method is inherited in dojox.dtl._Templated what causes the problem.

Changed 12 years ago by ID

Attachment: dijit._Templated.patch added

Real patch

comment:4 Changed 12 years ago by bill

Milestone: tbd1.4.1
Owner: changed from Neil Roberts to bill
Status: newassigned

comment:5 Changed 12 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [21124]) Declare _attachPoints in constructor() rather than buildRendering() so that DTL, which overrides buildRendering(), works again. Problem started in [20248] (refs #9966).

Thanks to ID and danstefan for the fix. Fixes #10612, #10526 !strict.

comment:6 Changed 12 years ago by bill

Strangely, the DTL automated tests mostly pass both before and after this change. Guess we need some more tests.

Anyway tell me if it's working (or not working) for you. (I just checked in the dijit._Templated.patch that ID attached.)

comment:7 Changed 12 years ago by Aleksey Rechinskiy

ID, thanks for the patch!

Bill, I've encountered an "this._attachPoints is undefined" error while I was examining a demo_FlickrRestStore.html and demo_FlickrStore.html demos for my MyTravelog project. Both of the samples throws an "this._attachPoints is undefined" exception while trying to load /dojox/dtl/tag/logic.js. After I applied a ID's patch to a local dojo copy, it started to work perfectly.

BTW: thanks all of you Dojo's do'ers for the 1.4 release! :)

Note: See TracTickets for help on using tickets.