コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.
解決済み

In AEM 6.5 how to iterate the values ​of a list modified by a method in the model?

Avatar

Level 2

 

With a multifield and textarea component I am trying to sightly print the values ​​inserted into the textareas and then print the modified values ​​by means of a method in the sling model.

I wrote <data-sly-list.commenta="${comments.listChildren}">

${comment.text}

${model.modifyText}

 

It continues to print only the values ​​entered from the dialog without printing those modified with the model

トピック

トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。

1 受け入れられたソリューション

Avatar

正解者
Community Advisor

Hi @Vodjakxa 
check the context

${model.modifyText @ context='html'}

 

Could you please share below:
1. How text and modifyText stored in the content page node.

2. Sling Model code?

 

If text and modifyText are stored in the same node then you can return list from sling Model and display both like 

<sly data-sly-list.commenta="${comments.listChildren}">
 <div>Text : ${commenta.text @ context='html'} </div>
 <div> Modify Text : ${commenta.modifyText @ context='html'} </div>
</sly>

 

Arun Patidar

AEM LinksLinkedIn

元の投稿で解決策を見る

3 返信

Avatar

正解者
Community Advisor

Hi @Vodjakxa 
check the context

${model.modifyText @ context='html'}

 

Could you please share below:
1. How text and modifyText stored in the content page node.

2. Sling Model code?

 

If text and modifyText are stored in the same node then you can return list from sling Model and display both like 

<sly data-sly-list.commenta="${comments.listChildren}">
 <div>Text : ${commenta.text @ context='html'} </div>
 <div> Modify Text : ${commenta.modifyText @ context='html'} </div>
</sly>

 

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 2

In the content page node comments are saved as children of comments. And for now it only prints the values ​​entered via the dialog. My intention is to be able to print those modified method values ​​in the model, called modifyText. In the model I added @RequestAttribute to the text attribute

Avatar

Community Advisor

Hi @Vodjakxa 

 

In your sling model, return the modified item list through getters and setters.

 

Please iterate through modified list using data-sly-list in sightly and print the modifyText 

${list.modifyText}

 

Hope this helps !