What is the best way to get enable the Save button with validation?

So for example I have a binder.addValueChangeListener() so that the save button can be enabled when everything is validated (in essence I run binder.validate() in the listener to decide whether or not to enable the save button). I know I could just do a validate on save but if possible I’d prefer to enable the save button only when possible. The issue is that when the user is on the last field they first have to click out of the field for the validation to enable the save button. I looked at using eager validation but then it seems to validate everything right away from the start (error messages everywhere). Is there a way to enable a save button cleanly when the last field is filled rather than when the mouse is clicked out of it?

You need to send the value to the server so the binder will be updated ( and the status of the save button), so you can change the value change mode from on_change to lazy for example flow/flow-data/src/main/java/com/vaadin/flow/data/value/ValueChangeMode.java at main · vaadin/flow · GitHub )

The challenge using lazy (or eager) is that as soon as a value is typed then all the fields are invalid. It fixes the save button but all the other fields are highlighted.

Part of the reason I’m doing this is because on a dialog I need to validate and if there are any issues and I present a notification window then it closes the dialog.

Instead of calling binder.validate() you can call binder.isValid() which doesn’t fire validation status events.

That helps a lot. Thank you.