Flexi.Form is the way to create forms in OLAT since release 5.2.
The following classes and the package elements define a infrastructure
and API for the Flexi.Form
- The atomic form element is the {@link org.olat.core.gui.components.form.flexible.FormItem}
- The {@link org.olat.core.gui.components.form.flexible.FormItemContainer} together with the
{@link org.olat.core.gui.components.form.flexible.FormItem} represents the
composite pattern.
- The {@link org.olat.core.gui.components.form.flexible.FormDecorator} is
available as $f in velocity pages and wraps an instance of a
{@link org.olat.core.gui.components.form.flexible.FormItem} in a velocity container.
It follows the decorator pattern,
although it does not add - but removes functionality of the decorated class.
- Each {@link org.olat.core.gui.components.form.flexible.FormItem} has a pair of
{@link org.olat.core.gui.components.Component} and
{@link org.olat.core.gui.components.ComponentRenderer}
to be compatible with the GUI Framework.
The Flexi.Form can be used in two ways - extend the
{@link org.olat.core.gui.components.form.flexible.impl.FormBasicController} or
create your own FooBarController, but in this case one has to implement
all form creation stuff itself. It is recommended to use the extending FormBasicController approach.
The impatient may read the
examples and how-tos here to quick start.
Nevertheless the curious people can
find the design decisions here.
For a deeper understanding you may also read the
comparison to the former form infrastructure.
General usage
TODO:pb: describe general usage
Basic form elements provided by Flexi.Form
TODO:pb: list elements
Behind the scene
TODO:pb: diagrams (class/sequence) explaining the main concepts
Benefit of Flexi.Form
Flexi.Form is the way to create forms in OLAT since release 5.2. It is
designed to
- add new form elements without changing the Flexi.Form
infrastructure
- form layout can be done with velocity, or a default is available
- start subworkflows within the form without loosing already entered form data
- AJAXified to make use of the fragment replace capability within the web GUI
framework
- register events on form elements like on click, on double click (see the
class {@link org.olat.core.gui.components.form.flexible.impl.FormEvent}).