Explicit XFA Host Transport
Unit: HPDFXFARuntime
Declaration
Options := TXFAWidgetRuntimeOptions.Default;
Options.ScriptOptions.EnableJavaScript := True;
Options.HostTransport := ApplicationHost.Transport;
Options.OnHostTransactionCompleted := ApplicationHost.Completed;
Behaviour
Configure explicit application callbacks to run xfa.host.messageBox, response, beep, print, gotoURL, submitForm, importData and exportData, and FormCalc Get, Post and Put
The library itself invokes no dialog, reader, network request or file transfer automatically; the callback implements the application transport and returns a typed response
Each dispatched request runs once within an enclosing runtime transaction; QuickJS suspension retries and committed-session replay consume recorded responses without repeating callbacks
Requests preserve positional arguments as Unicode strings, including empty arguments; request numbering starts at zero for each transaction
Failed transactions restore document and script-object state and notify the completion callback with Committed=False; the application must stage or compensate its external effects because document rollback cannot undo an external operation
Completion callbacks run once after successful document validation and layout or after rollback, before normal success observers; callbacks must not raise exceptions or re-enter the runtime
Host callbacks require the shipped QuickJS session; custom JavaScriptEvaluator callbacks do not provide the checkpoint and replay contract
Request count, argument count, encoded request bytes and response bytes have independent positive limits; callback elapsed time counts against the transaction deadline, but synchronous application code cannot be forcibly interrupted
Script functions receive number, Boolean, string, null or undefined according to the response Kind; numeric responses must be finite and Unicode responses must contain valid surrogate pairs
Related APIs
Explicit XFA Host Transport, TXFAHostTransaction and Interactive Dynamic XFA Widget Runtime