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.

Adding x Instances to a dynamic subform

Avatar

Former Community Member
Hi all!



I have this problem...



I have a form in which I have to type the number of months in which a

project goes on.

I would like that automatically Designer adds the correct number of rows in

order to compile the fields.



Example:

N. of period: 6

Then I have to add 6 rows to my form.



I succedeed in adding 1 row at time through a button, but it's not what I

want.

I thought that using



_subformname.AddInstance(x);



where x is the number of the N. of period fields would be enought to achieve

my goal, but it doesn't seem to work.



Any help?



Bye,

Alessio
2 Replies

Avatar

Former Community Member
addInstance() takes a true/false parameter, or alternatively a 0 or 1. I believe what you are looking for is setInstance(6)



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
<Chris_Trubiani@adobeforums.com> ha scritto nel messaggio <br />news:3bbe4789.0@webx.la2eafNXanI...<br />> addInstance() takes a true/false parameter, or alternatively a 0 or 1. I <br />> believe what you are looking for is setInstance(6)<br />><br /><br />Ok, setInstances(x) works.<br /><br />Thanks,<br />Alessio