Form Transitions

FormWidget provides extensive transitions for handling wide variety of Form related scenarios.


State Transitions

ID Next States Description
FORM_INIT FORM_INIT_LOAD Called when the FormWidget is initialized for the first time.
FORM_INIT_LOAD FORM_SCHEMA_BEFORE_LOAD, FORM_ERROR Prepares the form state after getting the form and validation schema. It also handles error if there is any error in retrieving the form schema.
FORM_SCHEMA_BEFORE_LOAD FORM_SCHEMA_LOADED, FORM_ERROR This transition can also be used to override and update the form schema dynamically. If there is any error, it goes to FORM_ERROR state and displays the error.
FORM_SCHEMA_LOADED FORM_DATA_FETCH, FORM_DATA_AFTER_LOAD, FORM_ERROR If ID of the record is provided in the FormWidget initial props, then it goes to FORM_DATA_FETCH transition, where it retrieves the data using the DataSource. FormWidget also accepts Record as an object, in this case, it goes to FORM_DATA_LOAD transition directly.
FORM_DATA_FETCH FORM_DATA_AFTER_LOAD, FORM_ERROR This transition, data is retrieved using the datasource or its already provided to the FormWidget.
FORM_DATA_AFTER_LOAD FORM_RELOAD, FORM_ERROR This is an intermediate transition and immediately goes to FORM_RELOAD.
FORM_RELOAD FORM_LOAD This transition applies display rules for fields that should be visible in the FORM and goes back to onLoaded state, this is the last step in the initial load of the FormWidget.
FORM_SUBMIT_CLICK FORM_BEFORE_SUBMIT This transition is triggered by the FORM submit button.
FORM_BEFORE_SUBMIT FORM_SUBMIT This is a BEFORE event transition to start the form submit loop, it can be used to override and do custom logic and complete the transition with FORM_SUBMIT.
FORM_SUBMIT FORM_AFTER_SUBMIT This is a default state for override, and calls the default datasource API on submit.
FORM_AFTER_SUBMIT FORM_LOADED, FORM_VALUE_RESET, FORM_ERROR This is a transition to close the SUBMIT loop, and it can be used to reset the FORM values or go to onLoaded state.