vaadin / framework

Vaadin 6, 7, 8 is a Java framework for modern Java web applications.
http://vaadin.com/
Other
1.78k stars 729 forks source link

Validation with multi error messages for a unique field #9256

Open pinonpierre opened 7 years ago

pinonpierre commented 7 years ago

Hi,

On Vaadin 8.0.5

I need to have validation with multi error messages for a unique field but for now, only one error can be emit for a field (In Vaadin 7, there was possible)

If the field has more that one failed validator, only the first error was displayed

Regards,

Legioth commented 7 years ago

Because of the way Binder allows defining validators both before and after converters are run, it would not be feasible to run all validators, and the converter might not support converting invalid input into something that could be passed to later validators. To avoid confusion, we're instead always only running until the first failing validator regardless of whether there are converters in between or not.

To work around this, you can define one big validator that internally collects errors from multiple "sub validators". The framework could also provide some kind of helper for making it easier to implement a validator that delegates to multiple validators and collects all messages.

pinonpierre commented 7 years ago

In some framework, we can indicate on validator itself if next validator must be executed.

stale[bot] commented 6 years ago

Hello there!

It looks like this issue hasn't progressed lately. There are so many issues that we just can't deal them all within a reasonable timeframe.

There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):

Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too!