[MGNLUI-6627] defaultValue not working for fields inside a switchable Created: 17/Mar/21  Updated: 27/Aug/21  Resolved: 19/May/21

Status: Closed
Project: Magnolia UI
Component/s: framework
Affects Version/s: 6.2.6
Fix Version/s: 6.2.9

Type: Bug Priority: Major
Reporter: Teresa Miyar Assignee: Martin Haderka
Resolution: Fixed Votes: 0
Labels: VN-Testing
Remaining Estimate: Not Specified
Time Spent: 0.25h
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Relates
causality
duplicate
duplicates MGNLUI-6680 ComboBox nested within SwitchableFiel... Closed
relation
is related to MGNLUI-5325 Support defaultValue in fields of new... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: Field default values
Sprint: UI FW 28
Story Points: 5

 Description   

Steps to reproduce

add the following field to a content app detail view

sample:
          $type: switchableField
          field:
            $type: comboBoxField
            layout: horizontal
            datasource:
              $type: optionListDatasource
              scrollToSelectedItem: true
              defaultValue: fastly
              options:
                - name: fast
                  value: fast
                - name: other
                  value: other
          itemProvider:
            $type: jcrChildNodeProvider
          forms:
            - name: fast
              properties:
                token:
                  $type: textField
                mytestfield:
                  $type: textField
                  defaultValue: test
            - name: other
              properties:
                other:
                  $type: hiddenField #originally staticField, but that one is not saved, probably was just a wrong config/typo

 Expected results

When opening the dialog mytestfield should have the value test, or if using a hiddenfield the value should be visible in jcr

Actual results

no default value in any of the tested fields, the hiddenfield is not saved

Workaround

save the value manually in jcr if using a hidden field

Development notes


Generated at Mon Feb 12 09:38:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.