As you can see I have both the inline and tray validation errors. How can I get rid off the inline editor error showing at the same row as “Ok” and “Annuler” buttons?
Refreshing didn’t help. The behaviour is somehow unpredictable, when I a create a product the field “code” gets the focus, when I tab to the next field I get the validation error correctly and the background colour doesn’t change to red (this is correct behaviour).
However when I input something in the “code” field and I delete it, and then I tab to the next field, I get the validation error (which is correct) but then the background colour of the field changes to red.
I attached a sample project, I hope it helps to spot the issue.
However I still don’t understand why I have different styles if press the key ENTER or if I press the tab key? When pressing enter, I get the the background to red but when I press tab, there is no background. In both situations I get the notification validation message.
DataGrid Editor handles enter press action and performs validation. As the “Code” field is required Editor sets to its connector error state. However, when the Tab key is pressed you perform validation in blur event but the error state is not set.
You can manage it by adding/removing styles from the field, for instance:
This is bringing me closer to my target solution. The behaviour of the DataGrid validation is interfering with the Editor and field validation.
On the creation of the Product, the code gets the focus in the inline editor which is correct. But if I click with the mouse again on the field being edited, it triggers the validation and shows the error message.
I would like to remove validation fired by the DataGrid in order to prevent this behaviour, but I didn’t find a way the API doesn’t provide access to the validators. Also when clicking on the cancel of the editor, it also trigger the validation.
Unfortunately, you cannot disable validation by the DataGrid editor. DataGrid fires validation when the user presses the “enter” key, clicks on the OK button, and if the field value is changed.
When the user clicks on the field Vaadin tries to focus editor cell, Blur event is fired, and then Vaadin focuses TextField. I’m not sure is there a workaround for this.
Probably, validation is triggered due to the field loses focus and blur listener is invoked.