[MGNLUI-5532] Issue with nullRepresentation vs default value in FieldBinders Created: 28/Nov/19 Updated: 22/Jul/20 Resolved: 24/Jan/20 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.2 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Milan Divilek | Assignee: | Adam Siska |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| 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
|
||||||||||||||||
| Sprint: | UI Framework & 6.2 Ramp up 15 | ||||||||||||||||
| Story Points: | 3 | ||||||||||||||||
| Description |
|
info.magnolia.ui.field.factory.FieldBinder.Default uses method com.vaadin.data.Binder.BindingBuilder#withNullRepresentation to propagate default value from field definition. This cause that field can't be set to empty because then it's every time converted to default value On the other hand info.magnolia.ui.field.TextFieldBinder set com.vaadin.data.Binder.BindingBuilder#withNullRepresentation to empty string which cause that default values is never used Reproduce:
select:
label: select
$type: comboBoxField
emptySelectionAllowed: true
defaultValue: Bartok
datasource:
$type: optionListDatasource
options:
- name: Vivaldi
value: Vivaldi
- name: Bach
value: Bach
- name: Bartok
value: Bartok
This definition allows empty selection in combobox, but after selecting the empty option and reopening dialog "Bartok" (defaultValue) is selected instead of the empty one Issue 2
salutation:
label: salutation
$type: textField
defaultValue: Mr
description: hello
In this definition defaultValue is completely ignored, because TextFieldBinder instead sets empty string |