aspose file tools*
The moose likes JSF and the fly likes Issue in localising client side javasctip validation error messages of Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Issue in localising client side javasctip validation error messages of "LiveValidation" in Seam  " Watch "Issue in localising client side javasctip validation error messages of "LiveValidation" in Seam  " New topic
Author

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

Cotton Gear
Greenhorn

Joined: Jun 02, 2008
Posts: 8
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.


Each one of us, teach(at least) one. <br />-Mahatma Gandhi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue in localising client side javasctip validation error messages of "LiveValidation" in Seam