FormΒΆ

/libs/granite/ui/components/foundation/layouts/form

The layout to render the form.

It has the following content structure at the layout resource:

granite:LayoutsForm
modestring
  1. default
  2. edit

The mode of the form.

default
The form is shown in readonly mode, where the fields are optimized for reading, instead of editing.
edit
The form is shown in edit mode, where the fields are ready to handle user inputs.
stylestring
  1. vertical
  1. vertical
  2. aligned

The layout style of the form.

vertical
The form fields (and their labels) are laid out in vertical manner.
aligned
The each form field is laid out side-by-side with its label.

The body of the form is specified using ItemDataSource.

Example:

+ myform
  - sling:resourceType = "granite/ui/components/foundation/container"
  + layout
    - sling:resourceType = "granite/ui/components/foundation/layouts/form"
  + items
    + item1
    + item2