8 Replies Latest reply on Apr 21, 2009 6:44 PM by Nate R

    Validation FacesMessage in DataTable?

    Bernhard Hurzeler Novice

      How do I validate input in a table and how to display a validation message?


      <rich:dataTable id="events" var="event" value="#{eventList.resultList}" >
               <rich:column breakBefore="true">
                <h:selectBooleanCheckbox id="approved" value="#{event.approved}" />
           </rich:column>
           <rich:column>
                <s:decorate id="commentDecoration" template="/layout/edit.xhtml">
                     <h:inputTextarea value="#{event.comment}" />
                </s:decorate>
           </rich:column>
      </rich:dataTable>
      



      In the code I have a method that gets called when I press an update button.


      public void update()
      {
           int counter = 0;
           for (Event event : eventList.getResultList())
           {
                if (event.isApproved())
                {
                     if (event.getComment() != null && event.getComment().length() > 0)
                     {
                          eventHome.setId(event.getId());
                          eventHome.setInstance(event);
                          eventHome.update();
                     } else
                     {
                          facesMessages.addToControl("What do I put here?",
                                         "Approval requires a comment!");
                                 }     
                }
                counter++;
           }
           return;
      }
      



      Furthermore how to I make SEAM aware that there is something wrong i.e. the invalid flag in edit.xhtml needs to be set to true. Do I need to through an ValidationException or do I return something in particular? Or should I use the @Validator instead. Is there an example on how to do this?

        • 1. Re: Validation FacesMessage in DataTable?
          Ingo Jobling Master

          Unfortunately, Seam does not, at this time, support adding messages to components in a table, this is a known problem, see JIRA.


          You can display a global message (easy), or write a JSF validator (harder, since the validation depends on other fields). 


          Hopefully future versions of Seam, JSF, and Beans Validator (JSF 303) will make this easier!

          • 2. Re: Validation FacesMessage in DataTable?
            Guillaume Jeudy Master

            Ingo made good points and I would certainly consider these options. As a last resort you can always code your validation behavior on the client side using javascript. Leverage Seam remoting if you need to consult the server for validation rules.


            This is even harder than implementing a JSF validator (validating at the row level) and should only be attempted if you don't have the choice.

            • 3. Re: Validation FacesMessage in DataTable?
              Bernhard Hurzeler Novice

              Ok I try the JSF Validator like:


              @Name("approvalValidator")
              @Validator
              @BypassInterceptors
              public class ApprovalValidator implements javax.faces.validator.Validator
              {
                  public void validate(FacesContext context, UIComponent component,
                       Object value) throws ValidatorException
                  {
                   // Obtain the client ID of the first approval field from f:attribute.
                   String approvedId = (String) component.getAttributes().get("approved");
              
                   // Find the actual JSF component for the client ID.
                   UIInput approvedInput = (UIInput) context.getViewRoot().findComponent(
                        approvedId);
              
                   // Get its value, the approval of the first field.
                   Boolean approved = (Boolean) approvedInput.getValue();
              
                   // Cast the value of the entered comment of the second field back to
                   // String.
                   String comment = (String) value;
              
                   // Compare the first password with the second password.
                   if (approved && comment == null || comment.length() == 0)
                   {
                       throw new ValidatorException(new FacesMessage(
                            "Comment can't be empty."));
                   }
              
                  }
              
              }
              



              and on the page


              <h:inputTextarea id="comment" value="#{event.comment}" required="true" >
                   <f:validator validatorId="approvalValidator"/> 
                          <f:attribute name="approvalId" value="tableForm:approval" />
              </h:inputTextarea>
                   <h:message for="comment" style="color: red;" />
              



              The problem is that I get the following IllegalStateException:


              18:10:34,218 WARN  [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@9b6b04) threw exception
              java.lang.IllegalStateException: com.nab.risk.validator.ApprovalValidator
                   at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:90)
                   at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1406)
                   at javax.faces.component.UIInput.restoreState(UIInput.java:1249)
                   at javax.faces.component.html.HtmlInputTextarea.restoreState(HtmlInputTextarea.java:836)
                   at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1141)
                   at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
                   at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
                   at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:414)
                   at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
                   at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
                   at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
                   at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
                   at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
                   at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                   at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                   at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                   at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                   at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                   at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                   at java.lang.Thread.run(Thread.java:619)
              18:10:34,218 INFO  [STDOUT] WARN  ExceptionFilter - handling uncaught exception
              javax.servlet.ServletException: com.nab.risk.validator.ApprovalValidator
                   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                   at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                   at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                   at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                   at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                   at java.lang.Thread.run(Thread.java:619)
              Caused by: java.lang.IllegalStateException: com.nab.risk.validator.ApprovalValidator
                   at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:90)
                   at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1406)
                   at javax.faces.component.UIInput.restoreState(UIInput.java:1249)
                   at javax.faces.component.html.HtmlInputTextarea.restoreState(HtmlInputTextarea.java:836)
                   at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1141)
                   at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
                   at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
                   at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:414)
                   at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
                   at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
                   at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
                   at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
                   at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
                   at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                   at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                   ... 41 more
              18:10:34,234 INFO  [STDOUT] WARN  ExceptionFilter - exception root cause
              java.lang.IllegalStateException: com.nab.risk.validator.ApprovalValidator
                   at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:90)
                   at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1406)
                   at javax.faces.component.UIInput.restoreState(UIInput.java:1249)
                   at javax.faces.component.html.HtmlInputTextarea.restoreState(HtmlInputTextarea.java:836)
                   at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1141)
                   at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
                   at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1157)
                   at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:414)
                   at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
                   at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
                   at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
                   at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
                   at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
                   at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                   at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                   at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                   at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                   at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                   at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                   at java.lang.Thread.run(Thread.java:619)
              18:10:34,234 INFO  [STDOUT] WARN  ExceptionFilter - running exception handlers
              18:10:34,250 INFO  [STDOUT] ERROR ExceptionFilter - could not roll back transaction
              java.util.EmptyStackException
                   at java.util.Stack.peek(Stack.java:85)
                   at java.util.Stack.pop(Stack.java:67)
                   at org.jboss.seam.transaction.SeSynchronizations.afterTransactionRollback(SeSynchronizations.java:45)
                   at org.jboss.seam.transaction.UTTransaction.rollback(UTTransaction.java:70)
                   at org.jboss.seam.web.ExceptionFilter.rollbackTransactionIfNecessary(ExceptionFilter.java:159)
                   at org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:113)
                   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:70)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
                   at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                   at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                   at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                   at java.lang.Thread.run(Thread.java:619)
              



              Please help...
              Thanks!

              • 4. Re: Validation FacesMessage in DataTable?
                Evgeny Denisov Newbie

                I've got exactly the same exception and found the cause: Validator class should implement Serializable interface.

                • 5. Re: Validation FacesMessage in DataTable?
                  Nate R Newbie


                  Unfortunately, Seam does not, at this time, support adding messages to components in a table, this is a known problem, see JIRA.


                  I have searched the JIRA and I can't find an issue related to this topic. Does anyone have a link to a related bug on JIRA?

                  • 7. Re: Validation FacesMessage in DataTable?
                    Brandon Simpson Newbie

                    I'm sure there's a better way to do it, but as a workaround, I just manually handled the validation for my data tables. I added a transient message field to the entity in my data table and manually set this to reflect the validation state along with highlighting the field with invalid data in red. It was a little bit extra work, but I care most about the end result. Anyone have a better way to handle this?

                    • 8. Re: Validation FacesMessage in DataTable?
                      Nate R Newbie

                      I took a different approach and added jQuery form validation. I am still using hibernate validator as another level of validation, but it is only running on form submit. It's also only rendering the error messages globally, since the local messages with s:decorate were causing the problems. jQuery form validation can render local messages without problems.


                      jQuery is already included in Richfaces, but I had to add the validation plugin. It's a large solution to a small problem, but like you, I care more about the end result.