I have a form where I would like users to be able to select a number from a drop down, and that number of instances of a specific subform get displayed, eg if they select 3 from the drop down, 3 instances of the subform display. I'm a LiveCycle newbie, so can anyone help me with a simple way to do this?
Solved! Go to Solution.
When a row is hidden when the form is created and you add instances of that row, it will add these rows as hidden because it is using the initial properties of the row.
You would have to set every rows which have been added to visible when they are created.
subform1.instanceManager.setInstances(5);
for (var i = 0; i < subform1.instanceManager.count; i++){
var frmSub = Main.resolveNode("subform1[" + i.toString() + "]");
frmSub.presence = "visible";
}
to do so you can use the setInstances() method
subform1.instanceManager.setInstances(2);
if you want to make the number of instance out of a selection in a dropdownlist you can use its value to set the instances
subform1.instanceManager.setInstances(dropdownlist.rawValue);
Views
Replies
Total Likes
Thanks Magus069, this works for me fine if the original instance of the subform is set to visible, but not when it is hidden (as I would want it to be in this form). Any suggestions for how to get around this?
Views
Replies
Total Likes
When a row is hidden when the form is created and you add instances of that row, it will add these rows as hidden because it is using the initial properties of the row.
You would have to set every rows which have been added to visible when they are created.
subform1.instanceManager.setInstances(5);
for (var i = 0; i < subform1.instanceManager.count; i++){
var frmSub = Main.resolveNode("subform1[" + i.toString() + "]");
frmSub.presence = "visible";
}
Thanks you so much. A little tweaking and I've got it working exactly how I want it now. Cheers.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies