Bean Validation JSR 303 errormessage not displayed

Hello,

I’m facing a problem with Bean Validation. I have implemented the validation using hibernate validator by following
these
instructions.

Everything seems to be working fine, I can see the errormessage being generated inside the BeanValidator but the message never seems to be displayed on the component which has the error. The red exclamation mark is there but when I hover it it never shows the errormessage. When I debug the component i can see there is no message being set.

Bean:

@NotNull
@Size(min=1, max=255)
private String description;

Form:


private BeanFieldGroup<Category> fieldGroup = new BeanFieldGroup<>(Category.class);

...

TextField description = new TextField("Description:");
description.setNullRepresentation("");

...

fieldGroup.bind(description, "description");

...

form.addComponent(description);

Can anyone point me in the right direction? Am I missing something?

Thanks,

Bart

Apparantly this has something todo with adding multiple annotations to the same field. When I remove the @NotNull everything works just fine.
Can someone please elaborate on this?

With which Vaadin version are you seeing the problem? Are you using the add-on or built-in BeanValidator in a version that has it?
Are the messages of all validation annotations missing, or is one of them working when having multiple annotations.

In any case, multiple validation annotations should work and you should get at least some message.
Please
create a ticket
about this.

Hi Henry,

It seems a problem with BeanValidation over FieldGroups in Vaadin 7.

I’m doing some proof of concept with the new components and features of vaadin 7 beta 4 right now, the problem that Bart has told appears only with the combination of @NotNull with any other Annotation, and as Bart says the problem disappears when @NotNull is removed.

I’ll make a try, if I’ve got some free time this weekend, with the latest beta release and I’ll post the results.

Greetings,

Javi

I created a ticket like you asked:
ticket