Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

repeat subform for each data item with javascript

Avatar

Level 2

Hello to all.

In my form I have a subform with the "repeat subform for each data item" property because it has a direct binding to a section of my xsd that can be present n times. in this subform there is a textarea with floating fields that have direct binding with the fields of the xsd inserted in this repeatable section. For one of these floating fields, however, I can not have direct binding but I have to set a javascript side logic for which I only have to display the "name" and "last name" fields or the "social reason" field based on their presence in each of the n sections of my xsd. Do you have any practical tips? Because I'm having serious difficulties. I tried to use a loop for, cycling for the n sections in my xsd and going to read, for each of these sections, the above 3 fields (name, surname and social name) but does not work because the loop for is repeated double, because of the presence of the "repeat subform for each data item" property. Help me please ...

form:

1310431_pastedImage_0.png

xsd:

1310440_pastedImage_2.png

textarea:

1310441_pastedImage_3.png

in this example you will have two textarea with inside:

for the first NOMINATIVE_ALTRO_RIC = name + last name;

for the second NOMINATIVE_ALTRO_RIC = social name;

0 Replies