Hi,
I'm going through a list and I need to dynamically create multiple data-sly-resources, so I understand that a different name must be assigned to each created component. I have the following code but I can not get it to work correctly, I only create 1 component and this is because it is probably assigning the same name to all the components. This is my code, any suggestions?
<sly data-sly-use.lstModel="com.rimac.core.models.TextListModel"></sly>
<div data-sly-list.lst="${lstModel.lstTextModel}">
<div data-sly-resource="${ '${lst.titleName}' @ resourceType='/apps/example/components/content/button'}"></div>
</div>
Thanks.
Solved! Go to Solution.
Thanks, finally I was able to solve it:
<sly data-sly-use.modelo="com.xxxxxx.core.models.formularioUnico.TextListModel"></sly>
<div class="title" data-sly-list.listado="${modelo.lstTextModel}">
<div data-sly-resource="${@path=listado.titleName, resourceType='/apps/xxxxx/components/content/titlecustom'}"></div>
</div>
Tranks all.
Hi,
You need to do like below:
<div data-sly-resource="${@path=lst.titleName, @ resourceType='/apps/example/components/content/button'}"></div>
e.g.
you can also do like this:
<p><div data-sly-resource=
"${'item{0}' @ format=multival1List.count, resourceType='wcm/foundation/components/parsys'}"
data-sly-unwrap></div></p>
Here we are generating the parsys dynamically. so that each component can have a separate unique id.
refer to this: Creating a Tab layout component for Adobe Experience Manager
~ Prince
Thanks, finally I was able to solve it:
<sly data-sly-use.modelo="com.xxxxxx.core.models.formularioUnico.TextListModel"></sly>
<div class="title" data-sly-list.listado="${modelo.lstTextModel}">
<div data-sly-resource="${@path=listado.titleName, resourceType='/apps/xxxxx/components/content/titlecustom'}"></div>
</div>
Tranks all.
I got the same issue, and this helps! Thank you!
Views
Likes
Replies
Views
Likes
Replies