[MGNLUI-4017] Selected option in SelectFieldOptionDefinition is ignored Created: 14/Sep/16  Updated: 20/Feb/17  Resolved: 16/Feb/17

Status: Closed
Project: Magnolia UI
Component/s: forms
Affects Version/s: 5.4.8
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Jordie Diepeveen Assignee: Khuong Nguyen
Resolution: Not an issue Votes: 1
Labels: None
Remaining Estimate: 0d
Time Spent: 1d 1h
Original Estimate: 4.5h

Attachments: PNG File Schermafbeelding 2016-09-14 om 16.18.22.png    
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:
Sprint: Saigon 82, Saigon 83
Story Points: 2

 Description   

It seems that the default selected option for all SelectFieldDefinition does not work anymore.
When opening the dialog, the value in the option list is not pre-selected according to the field definition (See sample code below).

- name: footerOption
  class: info.magnolia.ui.form.field.definition.OptionGroupFieldDefinition
  sortOptions: false
  layout: horizontal
  options:
    - name: empty
      value: empty
    - name: generic
      value: generic
      selected: true
    - name: education
      value: education


 Comments   
Comment by Khuong Nguyen [ 14/Feb/17 ]

Hi jdiepeveen,

  • For the OptionGroup Field (radio or checkboxes), null selection is allowed, so all options are unselected.
    If you edit a page that existed before, we do not apply default values. So if the select value is missing, only then it should be blank.

After I followed your description and try to investigate, in my opinion there is no bug. Here is steps that I reproduced.

Steps to reproduce:
1/ Follow MGNLUI- 4017 description and apply to Pages app
2/ Go to WEB DEV --> Resource Files
3/ travel-demo/dialogs/pages/pageProperties.yaml --> using the code in description to add new OptionGroupFieldDefinition
4/ Save and Publish

Add new case:
5/ Go to Pages App --> Add page – Choose template is Travel Home --> the default selected option work correct as configured.

Edit case:
6/ Go to Pages App --> Choose an item that existed --> Edit page properties --> take a look on Page properties dialog --> Nothing selected.

Best Regards,
Khuong Nguyen

Comment by Jordie Diepeveen [ 16/Feb/17 ]

Hi,

Thanks for checking out!

You're right! When a new page is created the selected option will work. When the page is already created before, the selected value is not selected by default.
Kinda make sense I think. I'm not sure that I tried it out with a new page.

Thanks for explaining!

Kind regards,
Jordie

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