Expand my Community achievements bar.

Using instance manager to add subforms

Avatar

Former Community Member
I've got a form which uses the instance manager to add/remove subforms, and it works fine. I just recently created a new XDP from scratch via designer, and cannot replicate the functionality. I have a single subform, with a flow layout, which contains two subforms, Header and Body. The header contains a button which should add an instance of body onclick. The body subform has the Repeat Subforms...checkbox checked and both min count and max count are unchecked. Whenever I click the button it says that the object has violated it maximum number of occurrances,even though there is no max set. Am I missing something else?



Here are the snippets I have tried onclick:



_Body.instanceManager.addInstance(true);

_Body.addInstance(true);

_Body.setInstances(1);



Thanks.
1 Reply

Avatar

Former Community Member
In the binding tab for Body, make sure you check "Repeat Subform for Each Data Item". If you don't then the min occurances of the subform is 1, and the max occurances for the subform is 1.



H.