• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Issue in localising client side javasctip validation error messages of "LiveValidation" in Seam

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are using LiveValidation javascript client side validation framework in our Seam 2.1 application to handle client side validation at the client side itself. We are using this as an addition to the HibernateValidation at the server side to reduce the server round trip and load. Though we are able to get the basic validations working for as desired these are the few issues I am struggling to find answers to:

1. Are there any other "best" approach/framework to handle client side validation at the client side in seam appliaction ?

2. How do we access and use the Hibernate Validation constraints values in the LiveValidation so that the validation requirements are defined at only one place as much as possible.
For eg: we define on the entity: @Length(min=5, max=10) . Now, I want to use the values 5 and 10 and also if possible map the "@Length" to the corresponding validator function of LiveValidation

3. How do we localize the javascript client side validation error messages like "Please enter the valid phone number."

I am including the "liveValidation.js" in the template.xhtml and in the individual xhtml pages I add the validation as below:

<h:form id="course" styleClass="edit">



I tried to use the JSF expression language inside the javascript part of the <f:verbatim>, but this is not allowed. The other option is to generate a javascript variables (eg:email_error_msg) and asign localised error messages as a value to these variables corresponding to the user locale and use these variables in the validation message. I tried these approaches but not able to make it work.

Please suggest as this will be very useful.

 
reply
    Bookmark Topic Watch Topic
  • New Topic