Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When creating a dialog, you usually want it to contain fields that build its core functionality for user tasks such entering a text into a field and sending it to the server upon hitting the SUBMIT button. Any field like that must be defined in a dialog definition through a field definition which must contain – at minimum – a property telling Magnolia what type of field it should render in the dialog.

Using the class property

Until the release of Magnolia 5.7, the only way to specify the type of a dialog field was to state a its fully qualified class name. For example, to define create a simple text field named title for  in a dialog's tab called tabText you had to include the following in your codecode in the configuration of the dialog:

Code Block
languageyaml
form:
  tabs:
    - name: tabText
      fields:
        - name: title
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition

Currently in a dialog definition, to specify the type of field you must supply a fully qualified class name of the field, for example:

to provide a fully qualified

  

class or a fieldType  

The definition by class is the traditional (older) way, very well known to Java developers. The definition by fieldType has been implemented in Magnolia with the release of the 5.7 branch and is oriented towards front-end developers who may have only very little or no knowledge of Java.

...

Using the fieldType property and field name shortening

For legibility, ease of development, and to make field names easier to remember, Magnolia 5.7 changed this in two ways:

  • You no longer need to define the field type using the fully qualified class name. You need to set just the field name proper via the fieldType property.
  • In selected modules (see the Short field names list further below on this page), the field name does not need even the -Field or -FieldDefiniton suffix. 

For the example with the text field this means that the configuration can look like as this:

Code Block
languageyaml
form:
  tabs:
    - name: tabText
      fields:
        - name: title
          fieldType: text


TODO

Short field names

Include Page
_field names shortening
_field names shortening