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

Edit the sub-beans with the composite fields is not possible for null attributes in beans

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Neutral
    • Resolution: Won't Fix
    • Affects Version/s: 5.5.4, 5.5.5
    • Fix Version/s: None
    • Component/s: forms
    • Labels:
      None

      Description

      When you try to edit subbeans using a composite field it has not effect for bean's attributes that are not initialized (i.e. attribute = null).

      It seems to be related to this code in info.magnolia.ui.form.field.AbstractCustomMultiField.createLocalField(FieldDefinition, Property<?>, boolean):

       // If the value property is not an Item but a property, set this property as datasource to the field
      // and add a value change listener in order to propagate changes
              if (!holdsItem(property)) {
                  if (property != null && property.getValue() != null) {
                      field.setPropertyDataSource(property);
                  }
                  field.addValueChangeListener(selectionListener);
              }
      

      When the value of the bean attribute is null, setPropertyDataSource is not set to property. So for the attributes that are not null have set correctly the datasource method pointing to the Bean and can be edited, but the attributes that are null are pointing to a transformer and edition has not effect.

        Checklists

        Acceptance criteria

          Attachments

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              miruela Mercedes Iruela
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  Checklists

                  Bug DoR
                  DoD