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

defaultValue is not applied within a multi value field

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 6.2.4
    • None
    • None
    • None
    • UI FW 13, UI FW 14
    • 2

      Property defaultValue is never applied for fields within a multi value field

      Steps to reproduce:
      Create a dialog which has a multi value field and within another field, e.g, a textField with a defaultValue. When the dialog opens, the defaultValue is never applied

      form:
        properties:
          multi:
            label: Addresses
            i18n: true
            $type: jcrMultiField
            itemProvider:
               $type: currentItemProvider
            field:
              label: ZIP
              $type: textField
              defaultValue: 41010
      

      Actual result:
      defaultValue is never applied
      Expected result:
      After opening the dialog, the defaultValue is written as value at the field
      Dev notes:
      Using the old UI, it works perfectly even with nested compositeFields within the multi value field:

      form:
        tabs:
          - name: tabMain
            label: Categories
            fields:
              - name: selectCategories
                fieldType: multiValue
                label: Select category
                field:
                   name: title
                   fieldType: composite
                   label: Event
                   fields:
                     - name: title
                       fieldType: text
                       label: Title
                       defaultValue: 0.5
                     - name: composite
                       fieldType: composite
                       label: whatever
                       fields:
                         - name: second
                           fieldType: text
                           label: Title
                           defaultValue: 0.5
      

      Using placeholder instead of defaultValue works

        Acceptance criteria

              apchelintcev Aleksandr Pchelintcev
              ccantalapiedra Carlos Cantalapiedra
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: