Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
BeanFieldGroup and JSR303 validation
Hi,
I just had a look at how FieldGroup/BeanFieldGroup is implemented in Vaadin7.
If I may, I would like to suggest a couple of things:
- currently, only fields are validated, but JSR303 allows for class level validation annotations as well. Use cases, that pop up in my mind:
* password1 & password2 matches
* date1 before date2
* is email already contained in database, but does not belong to this record.
For this to work, one needs to present the bean to the validator (ie. create a bean from potentially uncommitted fields). It would probably only be useful just before committing, and should - if I understand the 2phase commit correctly - be pretty easy to integrate.
- the same applies to ValidationGroups. JSR303 allows to specify validationGroups ie.
@Future(groups = { SomeCustomGroupDefinition.class, SomeOtherGroupDefinition.class })
In turn, you can pass one or more validation groups to the validator, and the validator will only use the annotations/validations, that belong to the given validation groups.
Great for validating a certain tab of a form, before switching to the next, but also ie. to have different validation logic for a customer frontend and a vaadin backend.
Without these two, I can see myself implementing custom validations over and over again - really error prone, if there's more than one frontend accessing the data.
It would be great, if you'd consider looking into these. I don't mind helping out, if you can give some vaadin specific architectural advice.
Thanks
Philipp
Hi Philipp,
You should create enhancement tickets for these at http://dev.vaadin.com. It makes it easier to discuss and track what is being done. I think #8096 is at least related to these issues.
All help provided is appreciated. What is usually a good starting point is a small example where you can see why it would be useful to have such features and how they would be used. Of course if you want to implement a proof of concept or full patch, that is good also :)
Thanks for the heads up.
Ticket is created at http://dev.vaadin.com/ticket/8406