Opened 9 years ago

Closed 8 years ago

Last modified 6 years ago

#12275 closed task (fixed)

_Templated: split into _TemplatedMixin and _WidgetsInTemplateMixin

Reported by: bill Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.6.0b1
Keywords: 1.7-mobile Cc:
Blocked By: Blocking:

Description

Split the current _Templated mixin into two mixins:

  • a _TemplatedMixin which doesn't support the widgetsInTemplate feature
  • a _WidgetsInTemplateMixin to add that support

Modify existing widgets to use _TemplatedMixin and, if necessary, _WidgetsInTemplateMixin.

_Templated will simply extend _TemplatedMixin and _WidgetsInTemplateMixin, and contain support for the deprecated waiRole/waiState template attributes. New widgets should directly use attributes, ex: role=foo aria-labelledby=bar. Everything in dijit already does this.

The goal of this change is to allow lightweight widgets to get template support without pulling in the parser.

Attachments (1)

templatedMixin.patch (77.3 KB) - added by bill 9 years ago.
before applying patch, do "svn cp _Templated.js _TemplatedMixin.js"

Download all attachments as: .zip

Change History (17)

Changed 9 years ago by bill

Attachment: templatedMixin.patch added

before applying patch, do "svn cp _Templated.js _TemplatedMixin.js"

comment:1 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed

(In [23940]) Split _Templated mixin into a lightweight _TemplatedMixin which doesn't support the widgetsInTemplate feature, and a _WidgetsInTemplateMixin to add that support.

Modified existing dijit widgets to extends _TemplatedMixin and, if necessary, _WidgetsInTemplateMixin.

_Templated keeps the same API (until 2.0, when it will be removed). It extends _TemplatedMixin and _WidgetsInTemplateMixin, and adds support for deprecated waiRole/waiState.

Fixes #12275 !strict.

comment:2 Changed 8 years ago by bill

(In [23947]) Fix typo in define()'s, refs #12275 !strict.

comment:3 Changed 8 years ago by bill

Keywords: 1.7-mobile added

comment:4 Changed 8 years ago by bill

(In [23993]) fix requires of _Widget and _Templated, refs #12275 !strict

comment:5 Changed 8 years ago by bill

(In [23994]) when extending Dialog and using widgetsInTemplate:true, now need to pull in _WidgetsInTemplateMixin, refs #12275 !strict

comment:6 Changed 8 years ago by bill

(In [23995]) missing dojo.require() of parser, refs #12275 !strict

comment:7 Changed 8 years ago by bill

(In [24000]) second arg to _applyAttributes() is now mandatory, refs #12275 !strict

comment:8 Changed 8 years ago by bill

(In [24093]) missing dojo.require() calls, refs #12275 !strict

comment:9 Changed 8 years ago by liucougar

(In [24257]) refs #12275: updated doc in _TemplatedMixin

comment:10 Changed 8 years ago by liucougar

(In [24258]) refs #12275: make dojox.dtl._DomTemplated work with dijit 1.6+

comment:11 in reply to:  10 ; Changed 8 years ago by ben hockey

Replying to liucougar:

(In [24258]) refs #12275: make dojox.dtl._DomTemplated work with dijit 1.6+

does this need to be ported to the 1.6 branch for 1.6.1 or did you mean 1.7+?

also, how does this behave when doing a build:

if(!templateString){
        templateString = dojo.cache(templatePath, {sanitize: true});
}

does the dojo.cache interning break during the build? if not, does the built version end up making an extra xhr call to get the template?

maybe completely drop support for templatePath in dtl if there is not support for it in dijit? as a side note, it's unfortunate that dtl seems largely abandoned.

comment:12 in reply to:  11 Changed 8 years ago by ben hockey

Replying to neonstalwart:

also, how does this behave when doing a build:

if(!templateString){
        templateString = dojo.cache(templatePath, {sanitize: true});
}

does the dojo.cache interning break during the build? if not, does the built version end up making an extra xhr call to get the template?

sorry... i see this same line in _TemplatedMixin so i assume it works ok in a build. however, you've brought to my attention at least one other bug in dtl which i've reported in #12644.

comment:13 Changed 8 years ago by liucougar

it should probably be committed to 1.6 branch (if there is a 1.6.1)

comment:14 Changed 7 years ago by bill

In [29986]:

focus a normal element instead of trying to focus <body>, refs #12275

comment:15 Changed 7 years ago by bill

In [30422]:

_earlyTemplatedStartup is for _WidgetsInTemplateMixin; no reason to (also) declare it in _TemplatedMixin, refs #12275 !strict

comment:16 Changed 6 years ago by bill

In [30792]:

widgetsInTemplate flag not necessary since extending _WidgetsInTemplateMixin, refs #12275 !strict.

Note: See TracTickets for help on using tickets.