[jboss-user] [JBoss Seam] - Hibernate validator and more error messages

martin.krajci do-not-reply at jboss.com
Wed Oct 24 15:24:05 EDT 2007


Hi conference,

I'm using hibernate validators in my Seam application:

xhtml:
					 	<s:decorate id="numberOfNightsDecoration" template="validate.xhtml">
  | 							<h:outputLabel value="#{msg.number_of_nights}" for="#{msg.number_of_nights}"/>
  | 							<h:inputText value="#{reservation.numberOfNights}" id="#{msg.number_of_nights}" required="true">
  | 								<a:support event="onblur" ajaxSingle="true" reRender="numberOfNightsDecoration">
  | 									<s:conversationId/>
  | 								</a:support>
  | 							</h:inputText>
  | 						</s:decorate>


java:

	@Min(value=1, message="#{messages['validator.min']}")
  | 	@Max(value=100, message="#{messages['validator.max']}")
  | 	@Column(name = "number_of_nights", unique = false, nullable = false, insertable = true, updatable = true)
  | 	public int getNumberOfNights() {
  | 		return numberOfNights;
  | 	}

and when I submit the UI form I with value 0 for numberOfNights I get more the same error messages in h:messages component.

	<f:subview rendered="#{! empty facesContext.maximumSeverity}">
  | 		<div class="errors">
  | 			<div><h:messages/></div>
  | 		</div>
  | 	</f:subview>

something like this:

# 	Value is too small 
# 	Value is too small 
# 	Value is too small
.

Do you have any idea why the error message is dispalyed in UI more times?

Thanx for any help.

Martin

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098504#4098504

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098504



More information about the jboss-user mailing list