title: Keep the parameters from managed Bean to a dialog open in PrimeFaces form using JSF
body: <p>I have a problem training with forms in PrimeFaces. I will try to explain in the best way:</p>
  
  <p>The functional idea is open a dialog in which the user can see certain inputs introduced previously.</p>
  
  <p>The fact is that I need to use (save) some properties from bean which I'm managing in the view when the dialog is opened.</p>
  
  <p>Example in code:</p>
  
  <p>My <strong>xhtml</strong> says:</p>
  
  <pre><code>    &lt;/h:form&gt;
  
          &lt;!-- Code Here --&gt;
  
          &lt;p:commandButton value="Preview" action="#{mockBean.showPreview}"/&gt;
  
          &lt;!-- Code Here --&gt;
  
          &lt;p:dialog id="myDialog" 
                    widgetVar="myDialog" 
                    modal="true" 
                    appendToBody="true" 
                    resizable="false"&gt;
              &lt;h:form&gt;                        
                  &lt;p:panelGrid columns="2"&gt;
  
                      &lt;!-- ...    Code Here --&gt;   
  
                      &lt;h:outputText value="Name" /&gt;
                      &lt;h:outputText value="#{mockBean.name}" 
                                    style="display:block; 
                                    width:225px"/&gt;    
  
                      &lt;!-- ... Code Here --&gt;
  
                  &lt;/p:panelGrid&gt;
              &lt;/h:form&gt;
          &lt;/p:dialog&gt;
      &lt;/h:form&gt;
  </code></pre>
  
  <p>My <strong>Bean</strong> says:  (MockBean.java)</p>
  
  <pre><code>&lt;!-- ... Code Here --&gt;
  
  public void showPreview(){
      RequestContext context = RequestContext.getCurrentInstance(); 
      context.execute("myDialog.show()");
  }
  
  &lt;!-- ... Code Here --&gt;
  </code></pre>
  
  <p>The mockBean.name property will be empty in dialog when, previously, and later, in view, the bean has a correct value </p>
  
  <p>I suspect that the solution will be easy but i'm newbie in this technologies and just'm introducing to this.</p>
  
  <p>Sorry if the question is absurd in part or something like that.</p>
  
  <p>Greetings.</p>