Solved: binder question

Imagine a form with a couple of text fields.

No troubles with the generic binding, but…
I want three of the text fields bind in a way, that at least one of them has the requirement to be filled, doesn’t matter which of them.

Sure I can check that with simple Java code, but is there an easy way to do that with binder, as it also marks them red as required when trying to save three empty fields?

Thanks for any ideas :slightly_smiling_face:
PS: Vaadin Flow 23.3.25

You can find an idea here with a custom validator that takes all three fields

Will have a look, thanks :slightly_smiling_face:

I would probably use a binder validation (see the link before) and show an error message when it’s invalid “You should fill at least one the 3 fields”, not necessary mark them as required or invalid because it’s not true.

Yes of course, you are right.
Thanks to you two!

Seems as knoobie had his hands on any available problem already :slightly_smiling_face: your link indeed helped here!

PS: I love this community!
PPS: I have used custom validators before, wonder why I haven’t thought of it at all :smile:

Solved: binder question