Expand my Community achievements bar.

Using master page in fragment

Avatar

Level 2

Hi,

in a AEM Forms document I use a fragment (let's call it A), which also includes the master pages where there is a title (let's call it H) to be placed at the top of the pages.
Through a for loop I create n instances of A (with addInstance method). Each of these instances of A can be x pages, with x variable. How can I associate a growing number with H for each instance of A?
That is, "text of H" + "1" on the pages of the first instance of A, "text of H" + "2" on the pages of the second instance of A, etc

1 Reply

Avatar

Community Advisor

Hi @utente2 

 

I am little new to AEM forms as well. But based on my understanding, you must be using Designer to create appropriate XDP forms for your use case forms.

 

In that XDP, you can add XFA scripts. In the script you can add logic to add a counter based on the instance of the title H. And next time H is found you can keep adding a number to it.

 

Similarly in the XDP we can add JS function as well.

 

Please add more details on what you may have tried to get more context.

 

Also this can be a question in AEM Forms community forum.

 

Regards