Handling End-User Events
The unit-elements-white-label-app and unit-elements-application-form components support custom events that enable you to respond to user interactions and component lifecycle events. You can add event listeners to handle these events and integrate them with your application logic.
| Event Name | Description | Detail |
|---|---|---|
unitApplicationFormCompleted | Occurs when an application form is filled/completed | ApplicationForm |
This event works for application form with statuses: AwaitingDocuments, PendingReview, Approved, Denied, Pending.
Example usage:
<unit-elements-application-form jwt-token="{{JwtToken}}">
</unit-elements-application-form>
<script>
document
.querySelector("unit-elements-application-form")
.addEventListener("unitApplicationFormCompleted", async function (e) {
const applicationForm = await e.detail;
const status = applicationForm.data.attributes.applicationStatus; // one of `AwaitingDocuments, PendingReview, Approved, Denied, Pending`
// Handle the application form completion based on status
});
</script>
For additional event details and examples, see White-Label App events.