[MGNLUI-5325] Support defaultValue in fields of new ui framework Created: 14/Aug/19  Updated: 07/May/21  Resolved: 14/Aug/20

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2, 6.2.1
Fix Version/s: 6.2.3

Type: Bug Priority: Neutral
Reporter: Federico Grilli Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 2
Labels: 62-UI-1, 622, defaultValue
Remaining Estimate: Not Specified
Time Spent: 0.3d
Original Estimate: Not Specified

Issue Links:
Cloners
is cloned by MGNLUI-6183 defaultValue in m5 dialog shown but n... Closed
Relates
relates to MGNLUI-4171 defaultValue is ignored when field is... Closed
relates to MGNLUI-5524 Default field values in new framework Closed
relates to MGNLUI-5532 Issue with nullRepresentation vs defa... Closed
relates to MGNLUI-5791 Dialog UX pain-points 6.2 Closed
relates to MGNLUI-4272 DateField: Also allow to set a 'defau... Open
relates to MGNLUI-3876 Translation of defaultValues in dialogs Closed
relates to MGNLUI-5958 defaultValue: now for date field is n... Closed
causality
is causing MGNLUI-6119 defaultValue in M5 checkbox dialog de... Closed
relation
is related to MGNLUI-6008 ContentType Model: "type: asset" does... Closed
is related to MGNLUI-6627 defaultValue not working for fields i... Closed
supersession
supersedes PAGES-280 DefaultValue does not work for page p... 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:
Epic Link: UI framework: configuration
Sprint: Maintenance 16, Maintenance 17, UI FW 7, UI FW 8
Story Points: 5

 Description   

Timebox: Find out via support tickets and other investigation which types of default values are problematic other than the example given in the last paragraph here. 5 SP

In M5 fields have the ability to support default values (optional property defaultValue), in order to present users with some predefined choices. It was assumed that the value was a String.

This property is still in the new field definition and now accepts a generic argument. Back in the day, a possible implementation was attempted, e.g. in the case of JCR, by specifying a node name (the configuration is commented out and still visible at contacts-v8.yaml). This no longer works as ItemToLinkConverter at JcrSelectFieldSupport tries to retrieve the model (a JCR Node) by uuid. However, when a defaultValue is provided as a node name the converter throws an exception (I assume that using uuid as default values would be most inconvenient for users).

Dev notes:

  • see Julian's comment below for reproducible example


 Comments   
Comment by Viet Nguyen [ 23/Jun/20 ]

Question from mboehm:

When can we expect a fix for this bug to progress through to a release? There doesnt appear to be any timeframe when this maybe resolved.

Comment by Aleksandr Pchelintcev [ 22/Jul/20 ]

jayala can you pls double-check whether you still can reproduce the example you attached - worked correctly for me with the latest 6.2.2

Comment by Roman Kovařík [ 18/Aug/20 ]

The default values are now supported in new framework.

  • default values are use only when creating new items,), not when editing items (same as in the old framework)
  • technically it means that default values are used when 
    • javax.jcr.Item#isNew=true
    • e.g. when adding a new item in browser via dialog, the selected item is still the persisted parent, so the dialog would not be populated with default values
Generated at Mon Feb 12 09:25:24 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.