1 Reply Latest reply on Jun 8, 2009 11:52 PM by nbelaevski

    Display message when email is sent

    oneworld95

      Hi. I've got an AJAX button on an XHTML Facelet page:

      <a4j:commandButton action="#{asset.sendEmail()}" value="Send Eamil" />


      This calls the following method:

      @In private Renderer renderer;
      
      public void sendEmail() {
       renderer.render("/mail.xhtml");
      }


      If the email is sent successfully, I'd like to display a message saying "Email was sent successfully", otherwise display the error. How do you accomplish this? Would it be a Try/Catch block in the sendEmail() method? Would I use the @Out annotation to send the message out of the component and make it available to the Facelet? Thanks.