Open vaadin-bot opened 11 years ago
Originally by DimitriL
Attachment added: Validation.gif
(9.6 KiB)
https://trac-attachments.vaadin.com/trac/12016/Validation.gif
Originally by @hesara
For a workaround see https://vaadin.com/old-forum/-/message_boards/view_message/3366235 .
Getting the correct locale for validation on the framework is somewhat more complicated, though - maybe it should come from each field to its validators so that setting the locale for a field or a layout would keep consistency between validators and fields.
Originally by oehme
I think this should have a priority, as the "workaround" is a mess and only works on commit. BeanValidation is basically useless without the correct locale.
Validators should probably have a reference to their field, so that they can use "getLocale" at validation time.
Originally by DimitriL
I think it would be even ok to take the locale from the UI. UI.getCurrent()...
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!
Originally by DimitriL
Given is the code (also available in the attachment as a project):
First appearance of the fields shows the validation errors in the German language (see the screen shot) but the locale is set to UK. The reason is in the method of the AbstractComponent#getLocale() which returns null as the locale because the field is not yet attached to the parent, but the validator is already initialized with the default (wrong) locale.
Imported from https://dev.vaadin.com/ issue #12016