Skip to content

Multifield

wcm/dialogs/components/textfield

Description

Multifield component allows to add/reorder/remove multiple instances of a field.

In the simplest case, this is a simple form input field (e.g. TextField, TextArea) but it can also be a complex component acting as an aggregate of multiple subcomponents (e.g. address entry).

Field used in multifield behaves the same as in plain dialog - e.g. hiding labels.

Properties

  • name - string (required)
    Form field name

  • label - string
    Display label value

  • required
    Indicates if field value is mandatory

Example

Multifield with TextField:

"users": {
  "sling:resourceType": "wcm/dialogs/components/multifield",
  "name": "users",
  "label": "users",
  "name": {
    "sling:resourceType": "wcm/dialogs/components/textfield",
    "name": "name",
    "label": "name"
  }
}

MultiField

Multifield with nested Multiefield

"users": {
  "sling:resourceType": "wcm/dialogs/components/multifield",
  "name": "users",
  "label": "Users",
  "namefield": {
    "sling:resourceType": "wcm/dialogs/components/textfield",
    "name": "name",
    "label": "Name"
  },
  "addresses": {
    "sling:resourceType": "wcm/dialogs/components/multifield",
    "name": "addresses",
    "label": "Addresses",
    "street": {
      "sling:resourceType": "wcm/dialogs/components/textfield",
      "name": "street",
      "label": "Street"
    }
  }
}