syntax problem ?

classic Classic list List threaded Threaded
3 messages Options
blr
Reply | Threaded
Open this post in threaded view
|

syntax problem ?

blr
Hi,

I use Dojo Toolkit.
In Dojo, there are some specific attributs for HTML5 : data-dojo-type, data-dojo-props
For example, I have those lines :

<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'My title',selected:true">
            Hi !
</div>

The title property have the value 'My title'.
I want to translate this property with Thymeleaf mechanism translation and I use th:attr.

I write those lines :
<div data-dojo-type="dijit.layout.ContentPane"
          th:attr="data-dojo-props=title:#{title.complex},selected:true">
            Hi !
</div>

I have an exception :

org.thymeleaf.exceptions.ExpressionParsingException: Could not parse as assignation sequence: "data-dojo-props=title:#{title.complex},selected:true"
        org.thymeleaf.standard.expression.StandardExpressionParser.parseAssignationSequence(StandardExpressionParser.java:161)
        org.thymeleaf.standard.expression.StandardExpressionParser.parseAssignationSequence(StandardExpressionParser.java:80)
        org.thymeleaf.standard.expression.StandardExpressionProcessor.parseAssignationSequence(StandardExpressionProcessor.java:60)

Why ?
Thanks,

Blr
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem ?

Zemi
Administrator
Hello,

try this:

     <div data-dojo-type="dijit.layout.ContentPane"
          th:attr="data-dojo-props='title:\'' + #{title.complex} + '\',selected:true'">
            Hi !
    </div>
blr
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem ?

blr
it's good !
thanks Zemi