[jboss-user] [JBoss Seam] - s:validateAll in custom tag/template

blackers do-not-reply at jboss.com
Wed May 23 21:25:55 EDT 2007


I am using seam 1.2.1GA and Jboss 4.0.5GA and am experiencing a problem when I try to use s:validate when the form fields are contained in a custom tag. 

my calling page calls a custom tag that I have created that contains a group of common form fields that I would like to reuse across many pages.  


  | <s:validateAll>
  | 	<tt:basicCRMFields title="#{signUp.title}" firstName="#{signUp.firstName}" lastName="#{signUp.lastName}" 
  | 				country="#{signUp.country}" email="#{signUp.email}" 
  | 				confirmEmail="#{signUp.confirmEmail}"/>
  | </s:validateAll>
  | 

the tag works fine as far as passing the data to my seam components but validation does not occur.

my tag .xhtml file looks like the following. 


  | 		<s:decorate id="titleDecoration" template="../../templates/decorateFormField.xhtml">
  | 			<ui:define name="label">Title:</ui:define>
  | 			<ui:define name="field">
  | 				<tt:salutationList id="title" value="#{title}" required="true">
  | 				</tt:salutationList>
  | 			</ui:define>
  | 		</s:decorate>
  | 		<s:decorate id="firstNameDecoration" template="../../templates/decorateFormField.xhtml">
  | 			<ui:define name="label">First Name:</ui:define>
  | 			<ui:define name="field">
  | 				<h:inputText id="firstName" value="#{firstName}" required="true">
  | 				</h:inputText>
  | 			</ui:define>
  | 		</s:decorate>
  | 		<s:decorate id="lastNameDecoration" template="../../templates/decorateFormField.xhtml">
  | 			<ui:define name="label">Last Name:</ui:define>
  | 			<ui:define name="field">
  | 				<h:inputText id="lastName" value="#{lastName}" required="true">
  | 				</h:inputText>
  | 			</ui:define>
  | 		</s:decorate>
  | 		<s:decorate id="countryDecoration" template="../../templates/decorateFormField.xhtml">
  | 			<ui:define name="label">Country:</ui:define>
  | 			<ui:define name="field">
  | 				<tt:countryList id="country" value="#{country}" required="true">
  | 				</tt:countryList>
  | 			</ui:define>
  | 		</s:decorate>
  | 		
  | 		<s:decorate id="emailDecoration" template="../../templates/decorateFormField.xhtml">
  | 			<ui:define name="label">Email:</ui:define>
  | 			<ui:define name="field">
  | 				<h:inputText id="email" value="#{email}" required="true">
  | 				</h:inputText>
  | 			</ui:define>
  | 		</s:decorate>
  | 		<s:decorate id="emailConfirmDecoration" template="../../templates/decorateFormField.xhtml">
  | 			<ui:define name="label">Confirm Email:</ui:define>
  | 			<ui:define name="field">
  | 				<h:inputText id="confirmEmail" value="#{confirmEmail}" required="true">
  | 				</h:inputText>
  | 			</ui:define>
  | 		</s:decorate>
  | 
  | 

Should it be possible that seam will validate my fields when used in this way?  It makes no difference if I add the s:validateAll to the tag .xhtml template file, validation still does not occur.  if I move one of the s:decorate fields directly into the calling file the validation works.  Is this the expected behavior?

Thanks
Mat

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

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



More information about the jboss-user mailing list