These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Inserting multiple instances of a subform

StevenD
Registered: Oct 6 2006
Posts: 368
Answered

Does anyone know how to specify multiple instances of a subform to be added? I want to click a button and have 12 instances of a subform added instead of just one. I have looked in the documentation but can't seem to find anything that will tell me how to do that.

StevenD

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can simply repeat the order for this action as often you need it.
Works fine, but looks terrible :-/

_MySubform.instanceManager.addInstance(1), _MySubform.instanceManager.addInstance(1), _MySubform.instanceManager.addInstance(1), ...
More professional is the following method. :-)
var oSubform = xfa.resolveNode("MySubform");oSubform.instanceManager.setInstances(12);

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

StevenD
Registered: Oct 6 2006
Posts: 368
Thanks radzmar. The second method looks good. I ended up using a for loop.

/*
for(i = 0; i < 12; i++)
{
mySubform.instanceManager.addInstance(1);
}
/*

Or something like that. I'm trying to go off memory since I'm at home and don't have my work computer that has the form on it.

Thanks for the suggestion and help. I will give the second option a try.

StevenD