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

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Neutral Neutral
    • None
    • 5.5.4, 5.5.5
    • forms
    • None

      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.

        Acceptance criteria

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

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD