Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Sling Model Invoked multiple times in AEM 6.4.8

rangavinod
Level 2
Level 2

We have list of articles which has picture and Image elements and rendered as list in Sightly. If the list goes above 20 content, sling model is invoked multiple times and causing performance issue. Any help or lead on this issue?

4 Replies
SureshDhulipudi
Community Advisor
Community Advisor

Are you using data-sly-list in HTL?

can you please provide more details (Source code of Sling Model and your HTL)

rangavinod
Level 2
Level 2
Yes. It is data-sly-list. It's happening only with the images.
SureshDhulipudi
Community Advisor
Community Advisor

Are you using any scripts for image lazy loading ?

 

data-sly-list should work without multiple calls

 

@Model(adaptables = {Resource.class}, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class StepspanelModel {

// Node - multified widget for images in dialog
@ChildResource(name = "stepimages")
private Resource imageResource;

private List<StepspanelImageTabModel> imageLinks ;

public List<SImageLinksModel> getSimagelinks() {
return simagelinks;
}

}

<div data-sly-use.stepspanelModel="com.corp.aem.guides.core.models.StepspanelModel">

<div data-sly-list.imagepath="${stepspanelModel.imageLinks}" data-sly-test="${stepspanelModel.imageLinks}">

<h4>Image Path::${imagepath.file}</h4>
<h4>Alt Text::${imagepath.alttext}</h4>
</div>
</div>