3 Replies Latest reply on Oct 14, 2007 12:20 PM by pmuir

    Validation messages with Seam 2.0 and Richfaces 3.1.0

    pdhaigh

      Hi,

      I am using the tabbed panel from Richfaces 3.1.0, and cannot get validation to work properly. Anything that is required=true correctly validates, but any other validation is simply not fired - e.g. max/min length etc: the form is just allowed to submit and throws an error when attempting to persist to the DB.

      Validation works just fine on pages without the tabbed panel component.

      Is there a particular trick for using this combination of components, or is this a bug (and if so, in Seam or RF?)?

      cheers

      phil

        • 1. Re: Validation messages with Seam 2.0 and Richfaces 3.1.0
          pdhaigh

          Interestingly, this only seems to affect <s:validateAll>... if I put <s:validate/> within a component, it works.

          So, to summarise:

          This doesn't work:

          <h:form>
           <f:facet name="afterInvalidField">
           <h:panelGroup><br/><s:message/></h:panelGroup>
           </f:facet>
           <f:facet name="aroundInvalidField">
           <s:span styleClass="error"/>
           </f:facet>
           <s:validateAll>
          
           <rich:tabPanel contentClass="tabbedpanel" switchType="client" selectedTab="#{customerManager.selectedTab}">
           <rich:tab label="General" name="General" >
           <h:outputText value="First name: "/>
           <s:decorate id="firstname">
           <h:inputText label="Customer first name" value="#{customer.firstName}" required="true">
           <a4j:support event="onblur" reRender="firstname" ajaxSingle="true"/>
           </h:inputText>
           </s:decorate>
           </rich:tab>
           </rich:tabPanel>
          </s:validateAll>
          
          </h:form>


          This does:

          <h:form>
           <f:facet name="afterInvalidField">
           <h:panelGroup><br/><s:message/></h:panelGroup>
           </f:facet>
           <f:facet name="aroundInvalidField">
           <s:span styleClass="error"/>
           </f:facet>
           <s:validateAll>
          
           <rich:tabPanel contentClass="tabbedpanel" switchType="client" selectedTab="#{customerManager.selectedTab}">
           <rich:tab label="General" name="General" >
           <h:outputText value="First name: "/>
           <s:decorate id="firstname">
           <h:inputText label="Customer first name" value="#{customer.firstName}" required="true">
           <a4j:support event="onblur" reRender="firstname" ajaxSingle="true"/>
           <s:validate/>
           </h:inputText>
           </s:decorate>
           </rich:tab>
           </rich:tabPanel>
           </s:validateAll>
          </h:form>
          


          Which leads me to suspect that this is in fact a bug.. although whether it's RichFaces or Seam I have no clue ;-)

          cheers

          phil

          • 2. Re: Validation messages with Seam 2.0 and Richfaces 3.1.0

            I have not tried it but this may help.

            http://in.relation.to/Bloggers/SeamValidation

            I don't think it has anything to do with RichFaces (at least not according to the blog post)

            • 3. Re: Validation messages with Seam 2.0 and Richfaces 3.1.0
              pmuir

              This was fixed in CR2