Opened 8 years ago

Closed 8 years ago

#18147 closed defect (invalid)

templateString replacers ${}

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.10.0
Keywords: Cc:
Blocked By: Blocking:


I have problem with latest version of Dojo. Template's replacers are not replaced.


templateString : "<div id='menu'>${menuTemplate}</div>",

constructor : function(data) {

this.menuTemplate = this.generateMenuItems(data);


App with old Dojo versions 1.8 - 1.9.1 works fine, but with new Dojo version displays markup or crash.

Not sure if it is bug of string module

or another dojo widget module.

please check it soon, because ${} replacers are important for widgets and need to know if it is bug or how to continue. This feature must work.

Change History (10)

comment:1 Changed 8 years ago by bill

#18148 is a duplicate of this ticket.

comment:2 Changed 8 years ago by bill

Owner: set to [email protected]
Status: newpending

Please attach a test case using the "attach file" button. It should be as small as possible to still reproduce the problem, almost always a single HTML file that we can load in the browser (i.e. not PHP, JSP, etc.).

Then, give exact instructions on how to reproduce the problem using your attached test file, including the browser and version to use.

The test case is necessary both to confirm that there's a bug, and for us to be able to debug the problem.

Alternately, you can give instructions on how to reproduce the problem with an existing test case (in the tests/ directory).


comment:3 Changed 8 years ago by [email protected]

Status: pendingnew

I try to prepare some test cases with new Dojo version during the weekend.

comment:4 Changed 8 years ago by dylan

All of the standard tests we have seem to pass, as well as our tutorials, e.g. , so I'd definitely be curious to see the test case where this is breaking.

comment:5 Changed 8 years ago by [email protected]

Hi You have right. In isolated environment it works fine. My testcases passed too. But we are using widgets inside dgrid. I must test it inside simple dgrid. We have a lot of problems with dgrid and dojox form manager. e.g. dgrid has any bug and modul which contains dgrid components are not able share. If I load it second time inside another widget, it returns empty object. I am sometimes frustrated from dgrid / dojo bugs.

comment:6 Changed 8 years ago by bill

Status: newpending

OK, but if you want us to look at it you still need to provide a test case, either here or in a bug filed against dgrid.

comment:7 Changed 8 years ago by [email protected]

Status: pendingnew

Findings. It seems it is not the dgrid problem. I have found today this issue but we have more problems with new Dojo. The problem is, that no error displayed in developer tools. e.g. Dgrid is not able to render itself. With old Dojo (1.9.1) it works fine.

Current finding.

observer : " data-dojo-props='intermediateChanges:true' data-dojo-attach-event='onKeyPress : update' ",

templateString : "<div ${observer}></div>";

observer string has quotation duplicity.

I must use observer : " data-dojo-props=intermediateChanges:true data-dojo-attach-event=onKeyPress : update ",

to avoid the parser error.

I try to create testcase tomorrow. In app it doesnt work with new Dojo. I will see if I am able to reproduce it.

Version 0, edited 8 years ago by [email protected] (next)

comment:8 Changed 8 years ago by bill

Status: newpending

Ah, in that case it's an error in your code that didn't manifest itself until #17286 was fixed. (Would have been nice to warn people in the release notes though.) Anyway, your template should say${!observer} not ${observer}. Try that and let me know if it works.

comment:9 Changed 8 years ago by [email protected]

Status: pendingnew

Thanks. You have right, it works fine. I was thinking about this solution, but wasn't sure because it was working.

Is it same for < character, isn't it?

comment:10 Changed 8 years ago by bill

Component: ParserDijit
Resolution: invalid
Status: newclosed

Yes, < is another character that gets escaped, so you need to use the ${!observer} syntax if your observer property contains tags.

Note: See TracTickets for help on using tickets.