Laurent NAVET
Laurent NAVET

Reputation: 11

add specific confirmation popup with composant h:commandButton

I have a page with this code (jsf 2.1.22 and primefaces 3.5) :

    <h:commandButton onclick="if (!confirm('Are you sure ?')) {return false};"
        value="SUP" action="#{utilisateurControleur.supprimerUtilisateur}" type="submit"
        rendered="#{profilModele.profil.codeProfil eq 'ACADMIN' and profilModele.utilisateur.login ne utilisateur.login}">

             <f:setPropertyActionListener target="#{utilisateurModele.utilisateurSelectionne}" value="#{utilisateur}" />
    </h:commandButton> 

The following statement works :

   onclick="if (!confirm('Are you sure ?')) {return false};"

but I wold like to show my popup where one answers yes or no :

   confirmSuppressionUtilisateurDialog.show();

Impossible to find the solution, can you help me? Thank you

Upvotes: 0

Views: 52

Answers (1)

cristianhh
cristianhh

Reputation: 138

Take a look at this: http://www.primefaces.org/showcase/ui/overlay/confirmDialog.xhtml I still have no idea why people don't just google their problems instead of posting it directly..

Upvotes: 1

Related Questions