Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10177

Multiple data-sly-attribute blocks on one HTL tag don't work correctty

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • None
    • None
    • Scripting
    • None

    Description

      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

      // 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>
      

      Expected Behaviour

      Expected HTML output

       <div a="val a" b="val b"></div>
      

      Actual Behaviour

      Actual HTL output

       <div b="val b"></div>
      

      Attachments

        Activity

          People

            radu Radu Cotescu
            radu Radu Cotescu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: