[
https://jira.jboss.org/jira/browse/JBSEAM-3438?page=com.atlassian.jira.pl...
]
Dan Allen commented on JBSEAM-3438:
-----------------------------------
Pete, I agree that would be nice, except that it only causes a problem in the other
direction. The issue in this case is that the Hibernate Validator is not behaving like the
other JSF validations. Searching for <h:outputLabel> would require us instrumenting
the standard JSF validators to make them everything consistent. Then there is the problem
that the <h:outputLabel> can have HTML. I think it makes sense to just fix the
problem at hand. I am going to move forward with the code.
Honor input's label attribute in ModelValidator message
-------------------------------------------------------
Key: JBSEAM-3438
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3438
Project: Seam
Issue Type: Feature Request
Components: JSF Controls
Affects Versions: 2.0.3.CR1, 2.1.0.BETA1
Reporter: Dan Allen
Assignee: Dan Allen
Fix For: 2.0.3.CR2, 2.1.0.CR1
Attachments: JBSEAM-3438.txt
Original Estimate: 15 minutes
Remaining Estimate: 15 minutes
Currently, the ModelValidator behaves unlike the standard JSF validators in that it does
not provide an indexed message parameter equivalent to the value of the input's label
attribute. Such a value is essential when messages cannot be displayed adjacent to the
input component on the page.
Here is an example of an input component that declares a label:
<h:inputText id="name" value="#{person.name}"
label="Name:">
<s:validate/>
</h:inputText>
Here is an example of a Hibernate Validator message key that uses this label:
validator.length={0} length must be between {min} and {max}
And here is what would be displayed had the validation failed:
Name: length must be between 0 and 20
Note that the label parameter would occupy the first and only indexed placeholder, {0}.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira