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 ancestor scopes of the old and requested fields: exit events run outward from the old field, and enter events run inward towards the new field

Ancestors shared by both fields receive neither exit nor enter a second time, and focusing the already focused field does not repeat its enter event

Moving from field A inside subform X to field B inside subform Y gives the event order A exit, X validate when enabled, X exit, Y enter, B enter; further ancestors follow the same outward and inward order

The existing edited-field validation runs before departure; ClearFocus keeps its existing policy of cancelling the active edit before focus is cleared

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 stays within the selected repeated row

Accepted empty contexts remain empty, and ambiguous or retired identities are never redirected to a neighbouring row or to 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 afresh before continuing

Atomic failure recovery

Ancestor scripts share the existing script, layout, reflow and elapsed-time limits; a rejected validation, a thrown script or an exhausted budget restores the previous document, values, editing buffer and focus

OnFocusChanged continues to publish field focus changes after successful commitment; parent scopes create no synthetic widget IDs and no extra host callbacks

Availability and scope

This runtime behaviour belongs to the core library and needs no Small Business or Enterprise registration

JavaScript handlers use the configured JavaScript provider and the existing script options; the literal event parser keeps its supported grammar

This capability covers focus enter and exit boundaries together with parent validation, leaving the separate typing change-event payload and mouse-event dispatch untouched

See Interactive Dynamic XFA Widget Runtime, Interactive XFA Change Events and the XFA 3.3 focus event sequence