Option list data source

The option list data source provides a static list of configured options. By default, it does not provide any component implementation itself other than the one required by select fields.

The option list data source is part of the Magnolia 6 UI framework. The fully qualified class name is info.magnolia.ui.datasource.optionlist.OptionListDefinition.

If you work with the Magnolia 5 UI framework, see Content connector instead.

The option list data source replaces the options configuration for select fields in Magnolia 5 UI. Previously, the option definition list was a core part of select field definition. This made it harder to convey the select fields that populate an item list in a more complex way than a predefined list of options (e.g. a database table or JCR workspace).

With the option list data source in Magnolia 6 UI, select fields can now specify the back-end configuration from which selection items are fetched. Preconfigured options then become concrete examples of such a data source, which only provides a predefined list of elements.

Example definition

datasource:
  $type: optionListDatasource
  options:
    - name: zambia
      value: zambia
    - name: argentina
      value: argentina
    - name: andorra
      value: andorra
    - name: switzerland
      value: switzerland
    - name: italy
      value: italy

List of properties

Property Description

class or $type

required

Use info.magnolia.ui.datasource.optionlist.OptionListDefinition for the class property or optionListDatasource for the $type shortcut.

options

required

Parent node for selectable options. See info.magnolia.ui.datasource.optionlist.Option for more information.

     value

required

Value saved to the repository when selected.

     name

optional, default is the parent node name

Name of the node where the selected value is stored. If no name is defined, the parent node name will be used instead.

     label

optional

Option label displayed to the user. The value is i18n-able.

     iconSrc

optional

Displays an image next to the option. The value is a path to the image.

name

optional, default is optionlist

Name of the data source.

sort

optional, default is false

When true, the list of options can be sorted.

Data source components

Module component mappings can be defined in the context of the current data source (a component section should have an id in the form of <id>datasource-<ds-name></id>, where <ds-name> is configured in the definition).

Type Implementation Description

info.magnolia.ui.field.SelectFieldSupport

info.magnolia.ui.datasource.optionlist.OptionSelectFieldSupport

Provides delegates required by select fields.

Component mappings in module descriptor
<components>
  <id>datasource-optionlist</id>
  <component>
    <type>info.magnolia.ui.field.SelectFieldSupport</type>
    <implementation>info.magnolia.ui.datasource.optionlist.OptionSelectFieldSupport</implementation>
  </component>
</components>
Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the DX Core docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules