Utility class to help creating and handling forms. A form has multiple FormField
s, a Validator
and some utilities that almost every form needs. Rendering the form is a seperate concern from doing validation and form submission.
Most important interactions with the form are described below
FormField
items.SubmissionHandler
to determine what to do when the submission is valid or not. The handler receives the Record
containing the fields and their values.This class also specifies the FormValidationResult
as an inner class. This interface defines the interaction with the validation result. Of course you can ask if the form is valid. You can also ask the error messages. These are split up in generic error messages as well as field specific error messages.
During form submission, a Record
is filled with the data of the form fields. The record makes it easier to get to the data without the specifics of the widgets. Custom records can be provided using the contructor. By default the {@see MapRecord} is used.
|
|
|
|
|
|
|
|