Message de confirmation avant suppression
Bonjour,
J'ai une jsp contenant un lien permettant de supprimer un enregistrement. Je souhaiterais qu'un message de confirmation apparaisse avant de supprimier l'enregistrement. J'ai essay de faire du javascrpt avec onclick="return confirm()" mais ca marche pas :cry:
Voici ma jsp:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<f:loadBundle basename="resources" var="bundle" />
<f:view>
<html>
<head>
<t:stylesheet path="/style/style.css">
</t:stylesheet>
<title></title>
</head>
<body>
<h1 class=".cHead">Liste des clients</h1>
<h:form>
<h:commandLink value="Nouveau..." action="#{clientBean.newClient}">
<f:param name="action" value="add" />
</h:commandLink>
<t:dataTable value="#{clientBean.clients}" var="row" rowClasses="LIGNE1,LIGNE2" >
<f:facet name="spacer">
<f:verbatim>&#160;</f:verbatim>
</f:facet>
<h:column>
<f:facet name="header">
<f:verbatim>Raison sociale</f:verbatim>
</f:facet>
<h:outputText value="#{row.raisonSociale}" />
</h:column>
<h:column>
<f:facet name="header">
<f:verbatim>Adresse</f:verbatim>
</f:facet>
<h:outputText value="#{row.adresse}" />
</h:column>
<h:column>
<f:facet name="header">
<f:verbatim>Téléphone</f:verbatim>
</f:facet>
<h:outputText value="#{row.telephone}" />
</h:column>
<h:column>
<f:facet name="header">
<f:verbatim>Fax</f:verbatim>
</f:facet>
<h:outputText value="#{row.fax}" />
</h:column>
<h:column>
<h:commandLink value="modifier" action="#{clientBean.selectedClient}">
<f:param name="selectedItem" value="#{row.id}"/>
<f:param name="action" value="update"/>
</h:commandLink>
</h:column>
<h:column>
<h:commandLink value="supprimer" action="#{clientBean.deleteClient}" onclick="return confirm('#{bundle['client.suppression']}')">
<f:param name="selectedItem" value="#{row.id}"/>
</h:commandLink>
</h:column>
</t:dataTable>
</h:form>
<br>
<br>
</body>
</html>
</f:view> |