This example demonstrates how to use the properties of the instance manager (which is part of the XML Form Object Model) to retrieve information about subforms at run time.
In the following form, the four buttons provide information about Subform1 by using the instance manger’s scripting properties. For example, when the form filler clicks the Max button, a message describing the allowed maximum number of supported Subform1 instances appears.
Livecycle common scripting tasks.106.13.1 Using the properties of the instance manager to control subforms
The following script uses the messageBox method to output the value of the count property:
xfa.host.messageBox(“The current number of Subform1 instances on the
form is:” + properties.Subform1.instanceManager.count, “Instance Manager
Properties”,3);
xfa.host.messageBox(“The current number of Subform1 instances on the form
is: ” + properties._Subform1.count, “Instance Manager Properties”, 3);
The following script uses the messageBox method to output the value of the max property:
xfa.host.messageBox(“The maximum number of instances allowed for Subform1
is: ” + properties.Subform1.instanceManager.max, “Instance Manager
Properties”, 3);
xfa.host.messageBox(“The maximum number of instances allowed for Subform1
is: ” + properties._Subform1.max, “Instance Manager Properties”, 3);
The following script uses the messageBox method to output the value of the min property:
xfa.host.messageBox(“The minimum number of instances allowed for Subform1
is: ” + properties.Subform1.instanceManager.min, “Instance Manager
Properties”, 3);
xfa.host.messageBox(“The minimum number of instances allowed for Subform1
is: ” + properties._Subform1.min, “Instance Manager Properties”, 3);
The following script uses the messageBox method to output the name of the subform property:
xfa.host.messageBox(“The name of the subform using the instance manager name
property is: ” + properties.Subform1.instanceManager.name +
“.\n\nNote: This value is different than the value returned by the name
property for the Subform1 object.” , “Instance Manager Properties”, 3);
xfa.host.messageBox(“The name of the subform using the instance manager name
property is: ” + properties._Subform1.name +
“.\n\nNote: This value is different than the value returned by the name
property for the Subform1 object.” , “Instance Manager Properties”, 3);

Using the properties of the instance manager to control subforms