aspose file tools*
The moose likes JSF and the fly likes JSF validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF validation" Watch "JSF validation" New topic
Author

JSF validation

Maciej Kaweski
Greenhorn

Joined: Mar 06, 2011
Posts: 2
Hi all

I use hibernate validator 4.0.2-GA (implementation of JSR 303) to validate my input fields. All works fine, but it always displays the message with the client id:

typeForm:title: Bitte einen Titel zwischen 6 und 128 Zeichen eingeben.

I want to get rid of this client id. Only the error message should be displayed:

Bitte einen Titel zwischen 6 und 128 Zeichen eingeben.

How can I do this?

Thanks a lot!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

Welcome to the JavaRanch, Maciej!

You can replace the validation message text on a generic basis for the entire webapp by defining and registering an alternate set of message text properties to JSF. However, since JSF 2 (or maybe 1.2), you can also define a message that's customized for just the control that you are already using. The attribute name is, I believe "validationMessage".


Customer surveys are for companies who didn't pay proper attention to begin with.
Maciej Kaweski
Greenhorn

Joined: Mar 06, 2011
Posts: 2
Hi
I already use the ValidationMessages property. I located the bug/fearure in MyFaces. It always prepends the label of the UInput, and if it is not defined, it prepends the ID. I didn't find a way to turn it off. I switched to Mojarra and everything is working fine now.
But if you know how to turn this behaviour off in MyFaces, please let me know.

Regards
Joschi
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

I has been a long time, but I think there actually is something for that.
 
wood burning stoves
 
subject: JSF validation
 
Similar Threads
a question about JApplet and JMenuBar
Westerns
WebSphere, WebLogic, .Net, NetWeaver and ....
Problem updating a dynamically populated selectOneChoice elements
<f:convertDateTime Problem