Concepts
There are three main concepts that sit behind the Albatross forms implementation:
- Field
- A data input field. It can format its output and validate its input. It contains a copy of the value so that the user can edit it without needing to maintain a separate copy in the application.
- Fieldset
Groups together a list of Fields and renders them in a table. It is conceptually related the HTML fieldset tag which groups related input fields together. Fieldsets are intended to only hold data fields. If you try to insert a Button into a Fieldset it's not likely to work, in part because Fieldset expects that each Field member will respond to certain methods, and in part because notionally is that buttons apply actions to all the fields in the fieldset.
- Form
- Manages the all of the fields in the form. Most interactions in the application are with Form instances: they coordinate loading values from model objects (typically attributes of classes) into the Fields, organise rendering and updating the values from the browser, validation, and storing the values back into the model objects.
Note that the Albatross form support doesn't emit an HTML form tag, the developer is still responsible for including that in the page template.