-
1. Re: Hibernate Validator {0}
asookazian Jul 29, 2009 10:20 PM (in response to israel.bgf)from SiA:
registration.welcome=Welcome to the club, {0}! facesMessages.addFromResourceBundle("registration.welcome", newGolfer.getName());
HTH
sorry, the spanish or portugese throws me off...
-
2. Re: Hibernate Validator {0}
israel.bgf Jul 29, 2009 10:34 PM (in response to israel.bgf)That's not the case Arbi. The problem is when trying to override the default Hibernate Validator messages.
From Seam Reference Chapter 10:
<h:inputText value="#{location.zip}" required="true" label="Zip:"> <s:validate/> </h:inputText>
You can then inject this value into the message string using the placeholder {0} (the first and only parameter passed to a JSF message for a Hiberate Validator restriction).
validator.length={0} length must be between {min} and {max}
I'm trying to do the same thing that the reference does, and it's not working.
-
3. Re: Hibernate Validator {0}
asookazian Jul 29, 2009 11:56 PM (in response to israel.bgf)So you have @Range or @Max and @Min specified on your entity methods?
I don't quite understand this:
You can then inject this value into the message string using the placeholder {0} (the first and only parameter passed to a JSF message for a Hiberate Validator restriction).
There is no code/example but perhaps it has to do with FacesMessages? Did you look in SiA or Yuan book?
-
4. Re: Hibernate Validator {0}
israel.bgf Jul 30, 2009 8:44 PM (in response to israel.bgf)Yes i put the annotations in my attributes. The problem is, when using the placeholder {0} in the message bundle, i should be able to replace it with the label attribute of an input component. Example:
class Person @Length(min = 1, max = 10) String name;
<h:inputText value="#{person.name} label="Name"/>
validator.length={0} length must be between {min} and {max}
The validation message (automatically triggered in the JSF validation phase) should be somethig like:
Name length must be between 1 and 10And i'm getting:
{0} length must be between 1 and 10 -
5. Re: Hibernate Validator {0}
joblini Jul 31, 2009 4:08 AM (in response to israel.bgf)Hello Isreal,
Should work, see JBSEAM-3438
What version of Seam are you using? Check the source code to be sure the patch is included.
Regards, Ingo
-
6. Re: Hibernate Validator {0}
israel.bgf Jul 31, 2009 3:33 PM (in response to israel.bgf)2.1.1, the patch should be here. But well.. i found the possible problem, i'm using the rich:graphValidator not the s:validateAll, maybe that's the problem. I tried to use the s:validateAll to test it, but it not worked; the validations errors don't get triggered in the JSF validation phase. Strange. Anyway, I will ask the richfaces guys about this, maybe the seam component that makes it possible. Thks ingo.