For example, if you use a router link to navigate from a view to another view containing a prefilled form and delete the contents of a text field that must not be empty, when validating, only the required indicator turns red, but neither an error message is displayed nor the text field is colored red.
If you perform a page refresh on the form, everything works as expected.
I can send you my sample project!
Expected-behavior
Click on a button to navigate from a view to another view containing a prefilled form and delete the contents of a text field that must not be empty, when validating, the required indicator turns red, the text field is colored red, and an error message is displayed.
Reproduction
Prepare:
Create a POJO containing String properties annotated with @NotEmpty.
Create an EditView containing a FormLayout and a BeanValidationBinder for that POJO.
EditView: For each of the String properties add a TextField and bind it by the property name.
EditView: Pre-fill the form by using binder.readBean (e.g. in the setParameter method)
EditView: Add a button with a click listener calling binder.writeBean
Create another view containing a RouterLink(EditView.class, 1) navigation to the EditView and pre-filling the form.
Execute:
Open the view with the RouterLink and click on the link.
The EditView opens and the form is pre-filled.
Empty a TextField
Click on the button
=> The validation passes and only the required indicator turns red.
Refresh the page with the EditView (browser refresh) and the pre-filled form
Empty a TextField
Click on the button
=> Validation fails the required indicator turns red, the field is red and an error message is shown.
Describe the bug
For example, if you use a router link to navigate from a view to another view containing a prefilled form and delete the contents of a text field that must not be empty, when validating, only the required indicator turns red, but neither an error message is displayed nor the text field is colored red.
If you perform a page refresh on the form, everything works as expected.
I can send you my sample project!
Expected-behavior
Click on a button to navigate from a view to another view containing a prefilled form and delete the contents of a text field that must not be empty, when validating, the required indicator turns red, the text field is colored red, and an error message is displayed.
Reproduction
Prepare:
System Info
macOS, Vaadin 24.1.3, Safari 16.5.1