3 Replies Latest reply on May 4, 2007 4:48 PM by sergeysmirnov

    How to show Alerts using Ajax4JSF

    mail2bansi

      If Ajax4JSF is replacement for Javascript wondering how to show Alerts using Ajax4JSF. For example displaying confirmation alert whenever user click on delete button
      Here is the snippet which uses JavaScript confirmDelete() method which results in a popup alert confirmation which i would like to replace it with Ajax4JSF

      <h:commandButton id="btnDelete" value="Delete" action="#{manufacturerBean.deleteManufacturer}"
       rendered="#{manufacturerBean.deleteBtnMode}"
       onclick="return confirmDelete();" styleClass="button" />
      


        • 1. Re: How to show Alerts using Ajax4JSF

          onclick="if (! confirmDelete()) {return false;};"

          • 2. Re: How to show Alerts using Ajax4JSF
            mail2bansi

            Sergey the confirmDelete() method you mentioned is a client side function in case of Javascript whereas i guess you are refering to server side function i.e. method in the backing bean. Wondering why do i need to have a function in backing bean just to capture user confirmation.

            Inside javascript function i can use built-in
            function "confirm(msg);" to invoke a popup alert to get a confirmation from the user. Is it possible to do something like this using Ajax4JSF i.e. show pop-up confirmation alerts on click of a button

            OR you refering to use a combination of Ajax4JSF with client side javascript function

            • 3. Re: How to show Alerts using Ajax4JSF

              Basni, tell me what you want - client site validation, client site confirmation, server side validation or any combination. I.e. try to ask a practical question or several different questions. So far, I am lost when try to understand what do you have and what do you want to have.