Native XFA instance managers

Unit: HPDFXFARuntime

Version 2.1187.0 extends ordinary provider-free FormCalc events with instance-manager access after the last member is removed, current occurrence limits, setInstances and actual new-instance return references

JavaScript can remain disabled and no script provider is required; the existing event transaction and execution limits remain in effect

Manager lifetime and empty groups

Use row.instanceManager or the accepted _row alias to manage an ordinary repeated subform group

A manager retained before removing the last member can add an instance again while its actual parent and declaration remain accepted; a fresh underscore lookup can address the same empty group

This applies to qualified bound and explicitly unbound groups, retaining their own parent and data context instead of borrowing another repeated row

The ordinary Form object of a removed member remains retired even after a replacement is added; removing the parent or rebuilding the Form with remerge also retires its previously held manager

Current properties and mutations

MemberBehavior
countRead the actual current number of group members, including zero
min, maxRead the current occurrence limits from the surviving group, or its retained prototype when empty; a maximum of -1 remains unbounded by occur while execution limits still apply
setInstances(count)Reach a valid integer count through actual add and remove actions, retaining minimum, maximum and shared instance-operation limits
addInstance()Add one member and return its actual Form object immediately
insertInstance(index)Insert one member at a valid index and return that actual new Form object

Current limit reads and mutations use the same actual group state, so a removed member's older occurrence limits cannot override a surviving member's updated limits

A returned member can be queried and edited immediately, and its own instance manager retains the accepted parent datasets group for further sibling additions

var manager = row.instanceManager
manager.removeInstance(0)
var created = manager.addInstance()
created.amount.rawValue = "new"
manager.setInstances(2)

This example requires an accepted group whose minimum permits zero and whose maximum permits two instances

Transactions and boundaries

Invalid counts, exhausted shared limits, retired references and ambiguous contexts fail within the existing event transaction; preceding changes are restored rather than partially published

The qualified profile covers ordinary accepted bound and unbound groups and their actual created members; general imported or generated contexts and additional DOM methods remain separate compatibility work; native conditional layout execution is available in its documented profile

See native FormCalc events, input references and shared limits and choice and data-node references