[MGNLUI-4184] SelectField: field property 'selected' is ignored Created: 06/Apr/17  Updated: 04/Aug/17  Resolved: 04/Aug/17

Status: Closed
Project: Magnolia UI
Component/s: dialogs, forms
Affects Version/s: 5.5.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Not an issue Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLUI-4264 Switchable Field default selection do... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   
        - name: maxLevels
          class: info.magnolia.ui.form.field.definition.SelectFieldDefinition
          label: Maximum Levels
          description: Maximum of level of pages shown in this recursion.
          type: Long
          options:
            - name: 1
              value: 1
              label: 1
            - name: 2
              value: 2
              label: 2
            - name: 3
              value: 3
              selected: true
              label: 3
            - name: 4
              value: 4
              label: 4
            - name: 5
              value: 5
              label: 5

The property 'selected: true' is ignored, with this configuration the option '1' is used when opening first time the dialog.



 Comments   
Comment by Sven Bach [ 10/May/17 ]

We have the same issue.
I used the select field example from the docs (https://documentation.magnolia-cms.com/display/DOCS/Select+field)
The property "selected" is ignored.
(Version: Magnolia 5.5.3)

Comment by Mikaël Geljić [ 03/Aug/17 ]

Hi cringele, sbach,

I cannot reproduce this. Mind that default values are only applied when the item is new—that is when it's being created.
This is intended, so that authors don't assume a value is already saved when it's not.

It does not matter if the dialog was never opened before. This is why at some point we started chaining the edit-dialog for pages and optional areas, right upon their create action.

That said, this is a common confusion about default values.
Either we make the item's stored-status more visible, or we need means to denote visually such non-persisted default values in fields first.

Hope this helps,
Mika

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