[MGNLUI-3451] Checkbox doesn't preserve default value upon switching to another language Created: 04/Jun/15 Updated: 17/Sep/15 Resolved: 30/Jun/15 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.10 |
| Type: | Bug | Priority: | Major |
| Reporter: | Zdenek Skodik | Assignee: | Evzen Fochr |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | support | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 7h | ||
| 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
|
||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||
| Epic Link: | Form field attributes handling | ||||||||||||||||||||||||
| Description |
|
Configuring selected=true, or defaultValue=true eventually, doesn't guarantee the checkbox to be ticked when the language in dialog is switched. |
| Comments |
| Comment by Evzen Fochr [ 29/Jun/15 ] |
|
Only possible solution i see is that for i18ned components we initialize property with default value for every language while opening dialog. (AbstractFieldFactory.createField) |
| Comment by Michael Mühlebach [ 01/Jul/15 ] |
|
You could implement it in the Transformer. It should have a ref to the field definition. And for example in the BasicTransformer a good place to set the default value might be #getOrCreateProperty() |
| Comment by Evzen Fochr [ 01/Jul/15 ] |
|
Its done in CheckboxFieldFactory, because i want to do it only for checkboxes. If it is done in BasicTransformer, it is changed for all components. I am not sure about this large scale change. |
| Comment by Ilgun Ilgun [ 08/Jul/15 ] |
|
CheckBoxFieldFactory
protected Class<? extends Transformer<?>> getTransformerClass() { Class<? extends Transformer<?>> transformerClass = definition.getTransformerClass(); if (transformerClass == null) { // TODO explain why down cast transformerClass = (Class<? extends Transformer<?>>) (Object) BasicTransformer.class; } return transformerClass; } private Property<?> initializeLocalizedProperty(Locale locale) { Class<? extends Transformer<?>> transformerClass = getTransformerClass(); Transformer<?> transformer = initializeTransformer(transformerClass); }
CheckBoxFieldFactoryTest
instead should be: checkBoxField.createField(;
|