Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-6239

DOC: Where to place common field properties in complex fields

XMLWordPrintable

      Support

      New ConfiguredSwitchableFieldDefinition does not implement info.magnolia.ui.field.FieldDefinition, so properties like required or readOnly are never applied.

      Steps to reproduce:

      Override HTML dialog definition with the following snippet:

      form:
        properties:
          switchable:
            $type: switchableField
            required: true
            field:
              $type: radioButtonGroupField
              layout: horizontal
              datasource:
                $type: optionListDatasource
                options:
                  - name: foo
                    value: foo
                  - name: bar
                    value: bar
            itemProvider:
              $type: jcrChildNodeProvider
            forms:
              - name: foo
                properties:
                  foo:
                    $type: textField
              - name: bar
                properties:
                  bar:
                    $type: richTextField
      

      Check the Problems tab in the Definitions app to see the required property is not recognized.

      DOCS

      https://documentation.magnolia-cms.com/display/DOCS62/Switchable+field

      When configuring a switchable field, many of the common field properties will be configured at the top level. This means that the inner fields will share some of those common configurations.

      This part is probably obsolete and should be removed.

      We are missing a description of how common field properties can be used in the context of switchable fields and probably also other complex fields (composite and multi fields). For example, the switchable field itself cannot be marked as required=true, but its two parts (field and forms) can. This distinction should be made clear in DOCS. Consider updating the YAML examples to make this more obvious.

      Other pages that are probably affected:

      https://documentation.magnolia-cms.com/display/DOCS62/Composite+field

      https://documentation.magnolia-cms.com/display/DOCS62/Multi+field

        Acceptance criteria

              akhamis Ashraf Khamis
              ccantalapiedra Carlos Cantalapiedra
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoR

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 0.75h
                    0.75h