[MGNLUI-3793] Explore notification of validation errors in composite fields Created: 01/Mar/16  Updated: 18/Apr/16  Resolved: 12/Apr/16

Status: Closed
Project: Magnolia UI
Component/s: dialogs
Affects Version/s: 5.4.4
Fix Version/s: 5.4.6

Type: Bug Priority: Neutral
Reporter: Ondrej Chytil Assignee: Ilgun Ilgun
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: 0d
Time Spent: 1.5d
Original Estimate: Not Specified

Attachments: PNG File case1-supp.png     PNG File case1.png     PNG File case2.png     PNG File case3a.png     PNG File case3b.png     PNG File case4.png     Text File case5.log     XML File config.modules.contacts.apps.contacts.subApps.detail.editor.form.tabs.personal.fields.rewardUrl.xml    
Issue Links:
Relates
causality
relation
is related to MGNLUI-3844 MultiValueField's validation is not c... 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:
Sprint: Basel 39
Story Points: 5

 Description   

Description

When validation of a field placed inside a composite field fails notifications are not working correctly.

Use-case 1 - field with validator configured under composite field:

  • when validation fails dialog is not saved and displays the generic error on top but user is not notified at concrete field with the specific error message.

Use-case 2 - required field without validator configured under composite field:

  • correct message is displayed ("This field is required.") but is tied to the composite field, not the concrete inner field.

Use-case 3 - required field with validator configured under composite field:

  • if the field was blank before and validation failed, error message for required field missing ("This field is required.") is displayed. Same as in use-case 2 it's tied to whole composite field.
  • if the field was not blank the same behavior as in use-case 1 will occur.

Correct behavior - error messages should be displayed under concrete fields and not be covered by required files missing message.

Use-case 4 - making changes on the select field (which is part of composite field) caused the below exception
See more in video: https://jira.magnolia-cms.com/secure/attachment/32694/SelectFieldValidation.webm

2016-03-17 10:59:08,524 ERROR .magnolia.ui.admincentral.AdmincentralErrorHandler: AdmincentralUI has encountered an unhandled exception.
com.vaadin.data.Validator$InvalidValueException: Country is required
at com.vaadin.data.validator.AbstractValidator.validate(AbstractValidator.java:103)
at com.vaadin.ui.AbstractField.validate(AbstractField.java:969)
at com.vaadin.ui.AbstractField.setValue(AbstractField.java:499)
at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:709)
at com.vaadin.ui.ComboBox.changeVariables(ComboBox.java:674)
at com.vaadin.server.communication.ServerRpcHandler.changeVariables(ServerRpcHandler.java:486)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:305)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:184)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:92)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1408)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:350)
at info.magnolia.ui.admincentral.AdmincentralVaadinServlet.service(AdmincentralVaadinServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at info.magnolia.cms.filters.ServletDispatchingFilter.doFilter(ServletDispatchingFilter.java:148)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)

Included file contains simple composite field configuration.



 Comments   
Comment by Mikaël Geljić [ 11/Apr/16 ]

So we can summarize this effort to 3 things:

  • In this ticket, we fix a problem with select fields, not having proper setup re: invalid values (so that validation is not thrown to the outside world)
  • In the followup ticket MGNLUI-3844, we investigate further the case #5, i.e. validation message being swallowed with nested complex fields (they should "bubble up" properly atm)
  • We're not pointing validation messages visually to a precise invalid sub-field, under maintenance. This requires substantial—and most likely API—changes.
    • Label of the sub-field points to it (and should be chained when nesting several complex fields)
    • Please mind that we do have an epic in 5.5 to address a number of issues, improvements and feature requests in the context of forms in the UI framework, probably best summarized at MGNLUI-2542 for now.

Thanks for your understanding,

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