Reset input fields in primefaces
primefaces
Solution
You can use this primefaces component: http://www.primefaces.org/showcase/ui/misc/resetInput.xhtml Regarding dialogs in general: don't put them inside forms. Have this instead: `<p:dialog><h:form>...` Regarding update="" values, if your appendToBody is true, put a colon in front of the id (that means it`s in another form).
Problem
I have a Dialog to input details. At the first time , InputText are empty. But from the second input, InputText maintain the previous value. This is my code : ``` <p:commandButton id="showDialogButton1" type="button" value="add" onclick="dlg1.show()" update="firstname1"/> <p:dialog id="dialogAjout" header="add department" widgetVar="dlg1" resizable="false"> <h:panelGrid columns="2" style="margin-bottom:10px"> <h:outputLabel for="firstname1" value="Libellé :" /> <p:inputText id="firstname1" value="#{departementBean.departement.libelleDepartement}" /> </h:panelGrid> <p:commandButton id="submitButton1" value="Valider" oncomplete="dlg1.hide();" action="#{departementBean.addDept()}" update="tabView"/> </p:dialog> ``` How can I resolve this, please !!