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
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
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>
Views
Replies
Total Likes
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>
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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 !
Views
Replies
Total Likes