title: Primefaces Dialog Update Mechanisms
body: <p>I was wondering which method should be used to update a Dialog in Primefaces.
  Are these two implementations equivalent?</p>
  
  <p>1st Method: Use dynamic attribute in dialog</p>
  
  <pre><code>&lt;h:form&gt;
      &lt;p:commandButton onclick="dialog.show();"/&gt;
  &lt;/h:form&gt;
  
  &lt;p:dialog widgetVar="dialog" dynamic="true"&gt;
      &lt;h:form id="dialogForm"&gt;
          &lt;h:outputText value="#{bean.name}"/&gt;
      &lt;/h:form&gt; 
  &lt;/p:dialog&gt;
  </code></pre>
  
  <p>2nd Method: Update dialog manually by commandButton</p>
  
  <pre><code>&lt;h:form&gt;
      &lt;p:commandButton onclick="dialog.show();" update="dialogForm"/&gt;
  &lt;/h:form&gt;
  
  &lt;p:dialog id="dialog" widgetVar="dialog"&gt;
      &lt;h:form id="dialogForm"&gt;
          &lt;h:outputText value="#{bean.name}"/&gt;
      &lt;/h:form&gt;
  &lt;/p:dialog&gt;
  </code></pre>
  
  <p>When should i use which method?</p>