[MGNLUI-3625] SwitchableField should only validate selected field Created: 15/Oct/15 Updated: 02/Oct/20 Resolved: 02/Nov/15 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | dialogs, forms |
| Affects Version/s: | None |
| Fix Version/s: | 5.4.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Federico Grilli | Assignee: | Federico Grilli |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 7.25h | ||
| 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: | |||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Basel 17 | ||||||||||||||||||||||||||||||||||||||||||||
| Story Points: | 2 | ||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Suppose you have a form with a radio button enabling to choose between a text field and a rich text field. Both fields are required. User selects and fills in the former but upon saving a validation error will occur complaining that the field not selected is required. |
| Comments |
| Comment by Mikaël Geljić [ 19/Oct/15 ] |
|
Linking to |
| Comment by Mikaël Geljić [ 23/Oct/15 ] |
|
To reiterate here: I'm puzzled about fixing validation in the SwitchableField properly, without fixing its super-class AbstractCustomMultiField. It's because of it that we can't benefit from default behavior for validate(), isEmpty() or getErrorMessage(). I contributed a semi-ugly patch to the PR (again, because of the AbstractCustomMultiField poor implementation, I had to replicate isValid(), and getErrorMessage from Vaadin's AbstractField). Now, since |