Weird data-sly-repeat behavior | Community
Skip to main content
Level 4
November 23, 2018
Solved

Weird data-sly-repeat behavior

  • November 23, 2018
  • 4 replies
  • 1933 views

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:

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by demd43642519

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 !

4 replies

smacdonald2008
Level 10
November 23, 2018

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 Models

arunpatidar
Community Advisor
Community Advisor
November 23, 2018

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
Feike_Visser1
Adobe Employee
Adobe Employee
November 24, 2018

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

demd43642519AuthorAccepted solution
Level 4
December 9, 2018

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 !