Bonjour j'ai un problème pour remettre des champs a vide après un enregistrement
voici une partie de mon code
Ce que je veux arriver a faire c'est une fois l'enregistrement effectué rester sur la même page mais avec les champs vider.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript"> function Message() { alert("Enregistré"); } </script> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <f:view> <h:form> <table> <tr> <td><h:outputLabel value="Nom"></h:outputLabel></td> <td><h:inputText value="#{personnelBean.personnel.nomPerso}" id="nomPersonnel" required="true" requiredMessage="Champ obligatoire" converterMessage="Format incorrect"></h:inputText></td> <td><h:message for="nomPersonnel"></h:message></td> </tr> <tr> <td><h:outputLabel value="Prenom"></h:outputLabel></td> <td><h:inputText value="#{personnelBean.personnel.prenomPerso}" id="prenomPersonnel" required="true" requiredMessage="Champ obligatoire" converterMessage="Format incorrect"></h:inputText></td> <td><h:message for="prenomPersonnel"></h:message></td> </tr> <tr> <td><h:commandButton value="Enregistrer" action="#{personnelBean.buttonEnregistrer}" onclick="Message()"> </h:commandButton></td> </tr> </table> </h:form> </f:view> </body> </html>
Pour le moment après l'enregistrement mais champs reste avec les valeur que j'ai saisie.
Pouvez vous me donner un coup de main
merci
Partager