[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4483) <s:validateAll/> doesn't perform hibernate model validations if manual control validator assigned

Vitaliy Tkachenko (JIRA) jira-events at lists.jboss.org
Mon Nov 23 11:37:36 EST 2009

<s:validateAll/> doesn't perform hibernate model validations if manual control validator assigned

                 Key: JBSEAM-4483
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4483
             Project: Seam
          Issue Type: Bug
          Components: JSF Controls
    Affects Versions: 2.1.1.GA
         Environment: Windows 7 + IE 8
            Reporter: Vitaliy Tkachenko


<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	<div class="decorated">
		<s:label styleClass="name #{overiddenStyle} #{invalid?'errors':''}">
			<ui:insert name="label" />
			<s:span styleClass="required" rendered="#{required}">*</s:span>
		<span class="value #{invalid?'errors':''}">
			<ui:insert />
		<span class="error">
			<h:graphicImage value="/img/error.gif" rendered="#{invalid}" styleClass="errors" />
			<s:message id="message" styleClass="errors" />

Using formField.xhtml:
	<s:decorate id="userNameField" template="/includes/formField.xhtml">
		<ui:define name="label">#{messages.login_username}</ui:define>
		<h:inputText id="userName" required="true"
			value="#{selectedUser.userName}" size="25" maxlength="50"
			readonly="#{not verifyUserAction.registeringUser}"
			<a:support event="onblur" reRender="userNameField" ajaxSingle="true"
				bypassUpdates="true" />

selectedUser.userName in the model:
	@Column(name = "user_name", unique = true, nullable = false, length = 50)
	@Length(min = 4, max = 50)
	public String getUserName() {
		return this.userName;

	public void setUserName(String userName) {
		this.userName = userName;

Seam in this case doesn't validate the user name control entry accordingly to "@Length(min = 4, max = 50)" for example and let's submit 3 characters length value, hibernate exception follows on the store procedure.

If the [validator="#{verifyUserAction.verifyUserName}] is cut from the userName field the model validation will be performed.

There is a hack for this case: <s:validate/> can be added too into the userName control and both hibernate and manual validators will be executed during the validation procedure.

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


More information about the seam-issues mailing list