-
1. Re: Validation messages with actual property names with <s:validateAll>
btonez Jun 2, 2008 3:57 AM (in response to infinity2heaven)I haven't tried it, but you could probably set the message attribute of each Hibernate Validator annotation to say @NotNull(message = "foo value is required") public Foo foo. But this would get verbose pretty quickly, and you said you wanted minimal code... So you could hack Hibernate Validator to do it for you :), OR even better, use <s:decorate> around each <h:inputValue>. See about 3/4 of the way through Chapter 10 of the Seam reference docs.
-
2. Re: Validation messages with actual property names with <s:validateAll>
infinity2heaven Jun 2, 2008 4:04 AM (in response to infinity2heaven)I dont want use <s:decorate> as I have a datatable with 20 rows (Each row having 6 columns). That would be insane.
This should be tackled at the source as the validator knows which property it's validating, it's just a matter of printing the value alongside the validation message ...
Strange, no one ever encountered this?
-
3. Re: Validation messages with actual property names with <s:validateAll>
pmuir Jun 2, 2008 11:12 AM (in response to infinity2heaven)I guess you could file a feature request for this.
-
4. Re: Validation messages with actual property names with <s:validateAll>
btonez Jun 2, 2008 2:40 PM (in response to infinity2heaven)I would imagine that the easiest implementation would be to hack on Hibernate Validator so that when the @NotNull annotation is processed, the field/property name is read and prepended to the message, unless a custom message is specified.
-
5. Re: Validation messages with actual property names with <s:validateAll>
infinity2heaven Jun 2, 2008 8:20 PM (in response to infinity2heaven)Raised a Jira
-
6. Re: Validation messages with actual property names with <s:validateAll>
fvalente Jun 6, 2008 11:53 PM (in response to infinity2heaven)You can specify the message for each propertie with the attribute requiredMessage on the respective input field.
-
7. Re: Validation messages with actual property names with <s:validateAll>
infinity2heaven Jun 7, 2008 12:03 AM (in response to infinity2heaven)1) you didnt understand my question. See the Jira Link above
2) It's message (not requiredMEssage)I dont need the validation message to be overridden, just append the property name to the existing message (as an option)