When a request is made to a page containing the form
component, the following sequence of events occurs.
- The form component looks up the form configuration for the item being requested.
- The form component retrieves the list of fields to display (if any) and requests a form definition for those fields and the item from the form service via its REST API.
- The form service looks for a form processor that can process the kind of item.
- The form processor is asked to generate a form definition.
- The form processor executes any registered filters before and after the main processing.
- The REST API takes the result from the form processor/form service and constructs the form definition JSON response.
- The form component receives the result from the form service and combines it with the form configuration to produce the form UI model.
- The form component Freemarker template iterates around the fields and includes the relevant controls.
- The form component Freemarker template instantiates the FormUI JavaScript component.
- The FormUI JavaScript instantiates the forms runtime and registers all validation handlers.
For a description of the available form controls, refer to Forms reference
At this point, the form is ready for the user to interact. When the user interacts with the form, the forms runtime constantly checks the validation rules enabling and disabling the Submit button appropriately. When the user submits the form, the following sequence of events occurs.
- The browser submits the form by calling the REST API.
- The form service looks for a form processor that can process the kind of item.
- The form processor is asked to persist the form data.
- The form processor executes any registered filters before and after the main processing.
- The REST API takes the result from the form processor/form service and constructs the JSON response.
- The browser receives the response and processes it appropriately.