title: PrimeFaces dialog keeps the previous value
body: <p>I use a dataTable to display the some records. The user can add/change records using a dialog named actionsDialog. Before saving the record, a modal dialog, called reasonDialog, is displayed and the user has to enter some reasons for the current operation. In my logic I set the reason to null after the data is saved into database.</p>
  
  <p>The problem appears when I repeat the operation. The reason contains the previous value. I have debugged the code and noticed that this happens because the reason is assigned the local value of the inputTextarea. How can I get rid of the local value? I am using PrimeFaces 3.0, Mojara 2.0.4, Tomcat 7.</p>
  
  <p>My reason dialog facelet is:</p>
  
  <pre><code>&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"&gt;  
      &lt;p:dialog header="#{label.reason}" widgetVar="reasonDialog"
          showEffect="fade" hideEffect="explode" modal="true" dynamic="true"&gt;        
          &lt;h:panelGrid columns="2"&gt;
              &lt;p:inputTextarea rows="5" cols="40" autoResize="false"
                  value="#{recordsBean.reason}" maxLength="1024" /&gt;
              &lt;f:facet name="footer"&gt;
                  &lt;p:outputPanel layout="block"&gt;
                  &lt;p:commandButton value="ok" update="genericRecords msgs"
                      action="#{recordsBean.execute}"
                      oncomplete="reasonDialog.hide();actionsDialog.hide()" /&gt;
                  &lt;/p:outputPanel&gt;
              &lt;/f:facet&gt;
          &lt;/h:panelGrid&gt;
      &lt;/p:dialog&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>The action dialog looks like this:</p>
  
  <pre><code>&lt;p:dialog id="actionsDialog" widgetVar="actionsDialog" dynamic="true"
      resizable="false" height="600" showEffect="fade" hideEffect="fade" modal="true"&gt;
  &lt;ui:include src="/WEB-INF/flows/genericRecord.xhtml"/&gt;
  &lt;f:facet name="footer"&gt;  
          &lt;p:outputPanel layout="block"&gt;
      &lt;p:commandButton value="save" onclick="reasonDialog.show()" /&gt;
      &lt;p:commandButton value="cancel" immediate="true" 
                  oncomplete="actionsDialog.hide()" /&gt;
      &lt;/p:outputPanel&gt;
  &lt;/f:facet&gt;
  &lt;/p:dialog&gt;
  </code></pre>