TXFAWidgetRuntime.UpdateDocument
Unit: HPDFXFARuntime
function UpdateDocument(AAction: TXFAUpdateDocumentAction): Boolean;
Executes an object-method action, calculations, and bounded stable reflow as one transaction; exceptions restore XDP and interaction state, and callbacks publish only after success
This method does not itself request a complete Form rebind. Use TXFAWidgetRuntime.Remerge when the intended operation is to reconstruct Form from the current Template and datasets and discard Form-only edits
Native Template editing
The callback receives the actual TXFADocument, including its Packet(xpkTemplate) tree. Native code can edit existing Template nodes inside this transaction, then request Remerge to rebuild Form from the changed Template and datasets
The focused unsigned XDP lifecycle (Tests/XFA/TemplateModel/Baseline/Review.en-us.md) verifies real Template changes, Form inheritance after remerge, saved XML, fresh-runtime reload and exact rollback after a failing native callback in 13 checks. This existing native capability is distinct from the JavaScript Template navigation and existing-node attribute methods, which use the event transaction
See Dynamic XFA Instance Presentation for binding and selector rules, supported event syntax, budget defaults, transactional publication, persistence, painting, and compatibility boundaries