Expand my Community achievements bar.

Problem with dynamically add subforms

Avatar

Level 2

I am trying to add subforms at runtime.  I used the provided example form and am unable to go past the 5 instances regardless of how I changed the code.  I  changed nNumSub to increase the subform instances.  No luck

if (nNumSub == 5)

{

xfa.host.messageBox("The maximum allowable number of subforms is 5. You cannot add any more subforms.

, "Warning", 3);

}

I did get lucky on one form but on the other with identical code and setup it doesn't work.  I included the working, non-working, and adobe example as reference.

I don't want to use add rows feature becaue on the table I am going to use I have more than 1 row on my table and that function won't work.  I have been getting weird stuff like this in the forms.  Sometimes my dynamic drop-downs won't expand on one form, my text fields won't expand to include multiple lines etc.  It's been hit or miss.

2 Replies

Avatar

Former Community Member

There is a max value set to 5 on the Subform2 object. High light the object in the hierarchy view and click on the Binding tab in the Object palette. You will see a Max size set to 5. This parameter is exposed to you in code but it is not being set in yours.

Paul

Avatar

Level 2

Thank you for pointing that out. I couldn't figure out what was going on. I didn't realize settings could overrride javascript.