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

Setting "selected" is true in Select field doesn't work in case of existing item

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an issue
    • Major
    • None
    • 5.4.12, 5.5.3
    • None
    • None

    Description

      Step to reproduce:
      • Import file to /modules/ui-framework/dialogs/rename/form/tabs/item/fields
      • Open Contacts app
      • Choose one item and select Rename contact

      Observation: Select field doesn't select Test 1
      Expectation: Test 1 must be selected

      Source of problem

      Since code was introduced from MGNLUI-4113

          public void setPropertyDataSourceAndDefaultValue(Property property) {
              this.field.setPropertyDataSource(property);
      
              if ((item instanceof ItemAdapter && ((ItemAdapter) item).isNew() && property.getValue() == null) || (!(item instanceof ItemAdapter) && property.getValue() == null)) {
                  setPropertyDataSourceDefaultValue(property);
              }
          }
      

      so in case of item is existed like contact item, #setPropertyDataSourceDefaultValue will never call

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                oanh.thai Oanh Thai Hoang
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD