Radu Cotescu created SLING-10177:
------------------------------------

             Summary: Multiple data-sly-attribute blocks on one HTL tag don't 
work correctty
                 Key: SLING-10177
                 URL: https://issues.apache.org/jira/browse/SLING-10177
             Project: Sling
          Issue Type: Bug
          Components: Scripting
            Reporter: Radu Cotescu
            Assignee: Radu Cotescu
             Fix For: Scripting HTL Engine 1.4.8-1.4.0


>From [https://github.com/adobe/htl-spec/issues/92:]

When multiple {{data-sly-attribute="$\{model.map\}"}} are used on a single HTL 
element, only the last one is evaluated. 

Given that the {{model}} and {{model2}} have a method {{map}} that returns a 
String -> String map, the following HTL code will not render attributes defined 
in {{model2.map}}

{code:html}
// model1.map -> \{'a' : 'val a'}
// model2.map -> \{'b': 'val b' }
 <div
 data-sly-use.model1="com.Model1"
 data-sly-use.model2="com.Model2"
 data-sly-attribute="${model1.map}"
 data-sly-attribute="${model2.map}">
 </div>
{code}

h3. Expected Behaviour
Expected HTML output
{code:html}
 <div a="val a" b="val b"></div>
{code}

h3. Actual Behaviour
Actual HTL output
{code:html}
 <div b="val b"></div>
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to