This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Posts: 8
  • Mark post as helpful
  • send pies
  • 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.

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!