Page tree
Skip to end of metadata
Go to start of metadata

CompositeFieldDefinition renders a complex field composed of multiple simple fields. Use a composite field for objects that cannot be expressed as simple text strings or numbers such as:

  • Setting conditions for selecting the next step in a multistep form.
  • Assigning categories to a content item, where the composite field consists of a category dropdown and a button for reordering categories.
  • Defining an image gallery using a media select field, where the composite media field consist of a thumbnail and caption text. 
  • Specifying an access control list for JCR workspaces, where the composite ACL field consists of permission, scope and path.

There is also a composite field for the JSON data source called JSON composite field.

This composite field definition is part of the Magnolia 6 UI framework. The fully qualified class name is info.magnolia.ui.field.CompositeFieldDefinition. If you work with the Magnolia 5 UI framework, see Composite field for Magnolia 5 UI instead.

The fully qualified class name of the JSON composite field is info.magnolia.rest.ui.field.JsonCompositeFieldDefinition. There is no corresponding implementation in the Magnolia 5 UI framework.

Composite field properties

properties

required

A list of editor property definition items (typically, a list of fields).

idPropertyName

optional (used only in JSON composite field)

Defines a unique property name for a JSON node.

propertyNameDecorator

optional, default is info.magnolia.ui.field.NoopNameDecorator

Decorates a property name for a node.

layout

optional, default is info.magnolia.ui.framework.layout.StackedLayoutProducer

Defines the field layout. The value must be a subtype of info.magnolia.ui.framework.layout.LayoutDefinition.

See Layout types for more information.

See also Common field properties.

Example composite field definition for JCR data source

composite:
  $type: compositeField
  itemProvider:
    $type: jcrChildNodeProvider
  properties:
	city:
	  label: city
	  $type: textField
	country:
	  label: country
	  $type: textField

Example composite field definition for JSON data source

The JSON composite field definition on lines 8-19 is displayed below as duplicated sets of simple text fields forming a multi field called stationboard.