Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Weird data-sly-repeat behavior

Avatar

Level 4

Hi guys,

I'm dealing with this weird data-sly behavior and I can't find an explanation for it.

Have you ever encountered it?

So I've got this data sly-repeat:

<div data-sly-repeat.result=${model.result}">

          <form class="randomclass">

               <input id="1" type="text"/>

          </form>

</div>

Expected: I should get 2 form rendered in my html page. but I get this:

1628411_pastedImage_1.png

1 Accepted Solution

Avatar

Correct answer by
Level 4

I found the issue that caused the problem.

Apparently my data-sly-repeat was inside another form which was not closed where it should be and looks like that caused the problem.
Now it's all fine, thank you !

View solution in original post

4 Replies

Avatar

Level 10

Looks like the model is not setup correctly. See this article as an example of how to work with a repeating data set -- Adobe Experience Manager Help | Creating a HTL Repeating Data Set 6.3 Component that uses Sling Mode...

Avatar

Community Advisor

Can you share your Java code as well, I can see there are 3 forms but 4 input tags. There is something wrong with HTL code and Java code as well.

Just for a test can you try with data-sly-list as well e.g.

<sly data-sly-list.myList=${model.result}">

  <div>

          <form class="randomclass">

              <input id="1" type="text"/>

          </form>

  </div>

</sly>



Arun Patidar

Avatar

Employee

you are missing a " here: <div data-sly-repeat.result=${model.result}">

Avatar

Correct answer by
Level 4

I found the issue that caused the problem.

Apparently my data-sly-repeat was inside another form which was not closed where it should be and looks like that caused the problem.
Now it's all fine, thank you !