EmailField validation broken on non-direct declare

I trying build unified edit dialog form for using in multiple views but EmailField validation doesn’t want to work.

Please tell me, I’m new to vaadin and I don’t really understand why this happens. Maybe you shouldn’t do that at all?

Example on screenshot in the attachment.
(“Email” field from realization, “test-email-field” added directly from AbstractEditFormDialog for demonstration)

Aabstract dialog form: https://pastebin.com/ecRCajU6
Realization: https://pastebin.com/gvHmDcwp
And view: https://pastebin.com/RcQnKrNK
(sorry for external links, source-code so long)

So, you use BeanValidationBinder without bean validation and expect validation? The email field does not valide itself (currently) on the server in this construct.

In this demo, I don’t need entity validation, but field validation. Is it interconnected? If it why does the test-email-field work? (this demo is not the only thing I tried. if I add an EmailField from the view, it will also be validated on UI)

You are overwriting the fields internal validation by binding it with the binder and there you have no contrains defined, that’s why the field (not within Binder scope) works as intended

Thank you. It turns out that when using the BeanValidationBinder the EmailField starts behaving like a TextField and passes the validation logic to the entity itself, didn’t think about it.

That’s exactly the case :+1: