Available Events
| Event | When Triggered | Purpose |
|---|---|---|
| onFieldChange | Field value changes | Track form changes |
| onFocus | Field gains focus | Handle field focus |
| onBlur | Field loses focus | Handle field blur |
| onUpload | File upload requested | Handle file uploads |
| onCapture | Barcode scan requested | Handle barcode scanning |
onChange Event
Triggered when any field value changes in the form. Parameters:- changes: [Change] - Array of change objects describing what was modified
- document: JoyDoc - The fully updated document with all changes applied
onFocus Event
Triggered when a field receives focus. Parameters:- event: FieldIdentifier - Information about the current focused field
onBlur Event
Triggered when a field loses focus. Parameters:- event: FieldIdentifier - Information about the field that lost focus
onUpload Event
Triggered when a file upload is requested for image or file fields. Parameters:- event: UploadEvent - Upload event details
- fieldEvent: FieldIdentifier - The field requesting upload
- multi: Bool - Whether multiple files are allowed
- uploadHandler: ([String]) -> Void - Callback to provide file URLs
onCapture Event
Triggered when camera capture is requested for Barcode cell. Parameters:- event: CaptureEvent - Capture event details
- fieldEvent: FieldIdentifier - The field requesting capture
- captureHandler: (ValueUnion) -> Void - Callback to provide captured content
onError Event
- Used to listen to errors during document processing.
- error: JoyfillError — details about the failure.
- Error types include:
- schemaValidationError — Document schema validation failures
- schemaVersionError — SDK and document version compatibility issues