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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -