Opened 10 years ago

Closed 10 years ago

#9250 closed defect (fixed)

Multiversion support does not work with widgetsInTemplate: true dijits

Reported by: James Burke Owned by: James Burke
Priority: high Milestone: 1.4
Component: Core Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:

Description

dojo.parser uses dojo._scopeName to figure out the name of the attribute to use for finding widgets. In a multiversion case, where scopeMap sets dojo._scopeName to something else, this helps find widgets that are in the top level HTML page, but it messes up finding widgets in widget templates, since normally in a widget template "dojoType" is used.

Possible fix: modify dojo.parser to expose the query it uses to find dijits, then in dijit._Templated, modify this query to use dojoType just for finding dijits in a template, then reset the dojo.parser query back to the original value.

This also has the benefit of allowing developer code to modify how dojo.parser finds dijits by allowing them to modify the dojo.parser query.

Attachments (1)

1.3.1.patch (2.3 KB) - added by Jared Jurkiewicz 10 years ago.
This is the changeset that will apply to 1.3.1. Just attaching here for reference.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 10 years ago by James Burke

Out of the default dijits, this practically only affects dijit.InlineEditBox? when autosave is false, but it also affects all developer code that uses widgetsInTemplate: true with widgets in them.

comment:2 Changed 10 years ago by James Burke

(In [17499]) Refs #9250: allow dojo.parser to expose the attribute used for querying, so that they can be reset for widgetsInTemplate parsing in multiversion scenarios.

comment:3 Changed 10 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [17500]) Fixes #9250: revert dojo.parser to using dojoType for widgetsInTemplate parsing so multiversion templates with widgets work.

comment:4 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: closedreopened

As best I can tell (using 1.3.1 and applying that changeset), the fix does not fix 1.3.1 (And probably not trunk).

I see the following when I dump the parser object (just before the if(parser_query != " [dojoType]"

_functionFromScript

function()

instantiate

function()

parse

function()

I don't even see an _query or _attrName function defined for this.

Did you perhaps forget to check in a change to the parser code? The changeset only shows _Templated getting touched.

comment:5 Changed 10 years ago by Jared Jurkiewicz

Argh, or I missed the first changeset! Grabbing that.

comment:6 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: reopenedclosed

Applied second changeset, testcase seemed to work. Okay, closing again and waiting to see of Joshua has any further issues.

Changed 10 years ago by Jared Jurkiewicz

Attachment: 1.3.1.patch added

This is the changeset that will apply to 1.3.1. Just attaching here for reference.

Note: See TracTickets for help on using tickets.