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.

Hidden addInstance


Former Community Member
I have a repeating subform that is a full page. I want it initially to be hidden and only called when needed.

I have created a 2 buttons on the repeating subform

Add Form



Delete Form


The initial instance is called from another page. This is the script for that Add Form button:



I have also tried adding this line:


If I set the subform to visible with a Minimum Count of 1, the repeating subform works.

If I set the subform to visible with an Initial Count of 0, the repeating subform does not work.

If I set the subform to hidden with a Minimum Count of 1, the repeating subform does not work.

Im stumped and dont know which way to turn. Any help would be appreciated.


1 Reply


Former Community Member

Presumably you don't need to set the subform to "hidden" if you also have a min count of 0. No instances will be created until your button is clicked (on some other page) that does form1.Subform1.instanceManager.addInstance(1);

Setting the subform visible should do the trick, if you choose to initially set it to hidden. Your script to show the subform was:

form1.Subform1.presence = "visible";

That script is only going to set the first instance of the subform to visible; it's equivalent to Subform1[0].presence = "visible"; You may need to update your script to use the index of the instance of the subform that you just added. (Still, I think in this case you don't really need to set the subform to hidden, to begin with).

Note that you only need to call recalculate() if you're targetting older versions of Acrobat; maybe earlier than 7.1?

I posted some (hopefully useful) information on this topic on a blog that i recommend you read:


See the "Script dependencies and "recalculate()" blog - which does get a little heavy as an article, but there's some good stuff in there.

If that doesn't help, please respond with more detail; I'm not sure what you mean by "does not work" in your last 3 lines; do you mean that the subform doesn't get created? or that it isn't visible?