Opened 5 years ago

Closed 5 years ago

#18147 closed defect (invalid)

templateString replacers ${}

Reported by: dojonovice@… Owned by: dojonovice@…
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.10.0
Keywords: Cc:
Blocked By: Blocking:

Description

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

e.g.

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 http://dojotoolkit.org/reference-guide/1.10/dojo/string.html#dojo-string

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 5 years ago by bill

#18148 is a duplicate of this ticket.

comment:2 Changed 5 years ago by bill

Owner: set to dojonovice@…
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).

Thanks!

comment:3 Changed 5 years ago by dojonovice@…

Status: pendingnew

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

comment:4 Changed 5 years ago by dylan

All of the standard tests we have seem to pass, as well as our tutorials, e.g. http://dojotoolkit.org/documentation/tutorials/1.10/templated/demo/templated-demo.php , so I'd definitely be curious to see the test case where this is breaking.

comment:5 Changed 5 years ago by dojonovice@…

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 5 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 5 years ago by dojonovice@…

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's 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.

Last edited 5 years ago by dojonovice@… (previous) (diff)

comment:8 Changed 5 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 5 years ago by dojonovice@…

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?

Last edited 5 years ago by dojonovice@… (previous) (diff)

comment:10 Changed 5 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.