Skip to main content
Level 3
Jun 25, 2024 7:54 PM UTC
Solved

How to add individual parsys for each iteration ?

Hi Team,

I am working on a use case, but stuck at one point that i have created a multifield component where we can create multiple cards shown in the below image. But as soon as these cards are created it should also have individual parsys below it for each card. The parsys should get add dynamically for each card. and the content added into the parsys should be hide and show based on the click on that card. but Here i am not able to add the parsys itself. Please help here.

 


My current HTL is

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Anudeep_Garnepudi
Anudeep_GarnepudiAccepted solution
Community Advisor
Jun 26, 2024 1:58 AM UTC

@monish_gavali 

Don't run a second loop. Include parsys in first loop before end of sly tag (i.e. before </sly>)

AG

4 replies

Level 4
Jun 25, 2024 8:10 PM UTC

hi @monish_gavali ,

Please try checking the Tabs component in AEM core component library which has similar implementation

 

reference : https://www.aemcomponents.dev/content/core-components-examples/library/core-content/tabs.html#tabs-9fea6f9326-item-478a696646-tab

 

Thanks,

Anil

Translate
Anudeep_Garnepudi
Community Advisor
Anudeep_GarnepudiCommunity AdvisorAccepted solution
Community Advisor
Jun 26, 2024 1:58 AM UTC

@monish_gavali 

Don't run a second loop. Include parsys in first loop before end of sly tag (i.e. before </sly>)

Translate
AG
h_kataria
Community Advisor
Community Advisor
Jun 26, 2024 4:35 AM UTC

The HTL looks OK. But can you check if the model is returning the expected value in xbrlCardDetails. And are you getting any errors in this ? 

Translate
EstebanBustamante
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Jun 26, 2024 12:26 PM UTC

Hi, 

Most likely the second time you loop your object this is empty because your HTL looks correct. My guess is that you are getting the xbrCardDetails values directly from an iterator, if that is your case, it is expected what you are seeing, and you can learn more here about it here: https://stackoverflow.com/questions/3831542/what-happens-if-you-call-the-same-iterator-twice-on-the-same-collection



Hope this helps.

Translate
Esteban Bustamante