3 Replies Latest reply on Aug 23, 2006 1:29 PM by Eric Ray

    Cannot get FacesMessages to work

    Eric Ray Novice

      bean code...

      
       @In(create=true)
       private transient FacesMessages facesMessages;
      
       ...
      
      if (!item.getCode().getCode().equals("SVD")) {
       facesMessages.add("closeButton", FacesMessage.SEVERITY_ERROR, "Remittance Item [#0] has not been saved.", item.getId());
       return "main";
       }
      


      web page...
       <h:form>
       <h:commandButton id="closeButton" action="#{packages.close}" image="../img/save_green.gif"
       styleClass="button"
       onmouseover="this.src='../img/save_green_over.gif';"
       onmouseout="this.src='../img/save_green.gif';"
       onmousedown="this.src='../img/save_green_down.gif';"
       onmouseup="this.src='../img/save_green.gif';"/>
       <h:message for="closeButton"/>
      
       <h:dataTable id="openPackageTable" value="#{openPackages}" var="pkgEntity"
      
      ...blah, blah, blah...
       </h:dataTable>
       </h:form>
      

      I cannot get the message to to display on the web page. Any ideas on what I'm doing wrong.

      Thanks.