java - Vaadin Form Validation with BeanFieldGroup -


in book of vaadin read following:

validating bean done beanvalidator, initialize name of bean property should validate , add the editor field. validation done after focus leaves field. bean validators automatically created when using beanfieldgroup.

so here's beanfieldgroup:

beanfieldgroup<ordersearchcriteria> binder = new beanfieldgroup<>(ordersearchcriteria.class); binder.setitemdatasource(searchcriteria); 

and how i've added validation on bean:

@min(0) private bigdecimal minamount;  @min(0) private bigdecimal maxamount;  @pattern(regexp = "([a-za-z]+@[a-za-z]+.[a-za-z]{2,})?") private string email; 

validation not automatically added thought would. missing?

you need download implementation of bean validator, , things start working out of box.

if you're using maven , want use hibernate-validator add dependency in pom.xml file this:

<dependency>     <groupid>org.hibernate</groupid>     <artifactid>hibernate-validator</artifactid>     <version>5.0.0.final</version> </dependency> 

references:


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -