Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#12644 closed defect (fixed)

dojox.dtl._DomTemplated breaks when included in a template

Reported by: ben hockey Owned by: Neil Roberts
Priority: low Milestone: 1.8
Component: DojoX DTL Version: 1.6.0
Keywords: Cc:
Blocked By: Blocking:

Description

http://bugs.dojotoolkit.org/browser/dojox/trunk/dtl/_DomTemplated.js?rev=24258#L22

this.template = this.template || this._getCachedTemplate(this.templatePath, this.templateString);

uses this.template which is set to true by http://bugs.dojotoolkit.org/browser/dijit/trunk/_WidgetsInTemplateMixin.js?rev=24258#L30

var cw = (this._startupWidgets = dojo.parser.parse(node, {
        noStart: !this._earlyTemplatedStartup,
        template: true,
        inherited: {dir: this.dir, lang: this.lang, textDir: this.textDir},
        propsThis: this,        // so data-dojo-props of widgets in the template can reference "this" to refer to me
        scope: "dojo"   // even in multi-version mode templates use dojoType/data-dojo-type
}));

this causes the dtl widgets based on _DomTemplated to break since it is expected that this.template is a string. perhaps _DomTemplated could shift to using _template?

this applies to the development version of 1.7

Attachments (2)

12644.diff (1.7 KB) - added by ben hockey 8 years ago.
changes template -> _template
12644.html (975 bytes) - added by ben hockey 8 years ago.

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by ben hockey

Attachment: 12644.diff added

changes template -> _template

comment:1 Changed 8 years ago by liucougar

Resolution: invalid
Status: newclosed

I checked, this.template is undefined in _DomTemplated.js?rev=24258#L22

comment:2 Changed 8 years ago by ben hockey

Resolution: invalid
Status: closedreopened

i'd appreciate a more thorough look. this bug is definitely valid.

i included the reference to _WidgetsInTemplateMixin in the description to try and show how this problem occurs but i guess i wasn't explicit enough. this.template will be true when the DomTemplated? widget is included in the template of another widget. it will be undefined when the DomTemplated? widget is declared on it's own.

to help clarify, i'll attach a test case as i should have done to begin with - sorry.

Changed 8 years ago by ben hockey

Attachment: 12644.html added

comment:3 Changed 7 years ago by ben hockey

Resolution: fixed
Status: reopenedclosed

In [27959]:

fix conflict with this.template property by ignoring it if it is true.

fixes #12644 !strict

comment:4 Changed 7 years ago by ben hockey

Priority: highlow

comment:5 Changed 7 years ago by bill

Milestone: tbd1.8
Note: See TracTickets for help on using tickets.