XFA Ancestor Focus Events
Version 2.1166.0 extends the core TXFAWidgetRuntime focus transaction to matching subform and exclGroup ancestors, including forms whose only focus scripts belong to those ancestors
Crossing a scope boundary
FocusWidget compares the old and requested fields' ancestor scopes: exit events run from the old field outward, and enter events run inward toward the new field
Ancestors shared by both fields receive neither exit nor enter again, and focusing the already focused field does not repeat its enter event
When moving from field A inside subform X to field B inside subform Y, the event order is A exit, X validate when enabled, X exit, Y enter, B enter; additional ancestors follow the same outward and inward order
The existing edited-field validation runs before departure; ClearFocus retains its existing policy of canceling the active edit before clearing focus
Repeated instances and script context
A parent handler runs with its actual owner as this and the accepted data context for that presentation, so relative field lookup remains inside the selected repeated row
Accepted empty contexts remain empty, and ambiguous or retired identities are not redirected to a neighboring row or a field at the same ordinal
Scripts may request another focus target through the supported host model; after each event or validation, the transaction resolves the current target and common ancestors again before continuing
Atomic failure recovery
Ancestor scripts share the existing script, layout, reflow and elapsed-time limits; a rejected validation, thrown script or exhausted budget restores the previous document, values, editing buffer and focus
OnFocusChanged continues to publish field focus changes after successful commitment; parent scopes do not create synthetic widget IDs or extra host callbacks
Availability and scope
This runtime behavior belongs to the core library and requires no Small Business or Enterprise registration
JavaScript handlers use the configured JavaScript provider and existing script options; the literal event parser retains its supported grammar
This capability covers focus enter and exit boundaries and parent validation, with no change to the separate typing change-event payload or mouse-event dispatch
See Interactive Dynamic XFA Widget Runtime, Interactive XFA Change Events and the XFA 3.3 focus event sequence