title: Empty variable when open <p:dialog> - JFS 2.0, Primefaces
body: <p>how're you?</p>
  
  <p>Maybe a newbie question now. Now I have one input and a "submit" button inside a form. When I click in submit, this doesn't call any method, this just opens a <code>&lt;p:dialog&gt;</code>. When this dialog is opened, the variable in input wasn't setted, so another input I have in  doesn't show anything. </p>
  
  <p><strong>See the images to understand:</strong>
  <img src="https://i.stack.imgur.com/pc5FA.png" alt="Before click in &quot;submit&quot; button"></p>
  
  <p>After click in "submit" (Adicionar):
  <img src="https://i.stack.imgur.com/UX3KJ.png" alt="After click in &quot;submit&quot; (Adicionar)">
  This second image must show exactly the same value of the first input, but as you can see this just shows a empty input. </p>
  
  <hr>
  
  <p>Now let's go to my code. </p>
  
  <p><strong>Here's my JSF:</strong></p>
  
  <pre><code>&lt;h:form id="inserirDisciplina"&gt;
  
      &lt;h:inputText styleClass="form-control" id="disciplina" value="#{cursoMBean.nome}"
        valueChangeListener="#{cursoMBean.atualizarListagemPesquisa}"&gt;
        // atualizarListagemPesquisa just update the arraylist to be shown in dataTable
  
          &lt;f:ajax event="keyup" render=":meuForm:minhaTabela" /&gt;
      &lt;/h:inputText&gt;
  
      &lt;h:commandButton value="Adicionar" styleClass="btn btn-md btn-success"&gt;
          &lt;p:ajax event="click" update=":meuForm:display" render=":meuForm:dialog" oncomplete="PF('insert').show();" onerror="alert('erro');" /&gt;
      &lt;/h:commandButton&gt;
  
      &lt;p:dialog id="dialog" header="Inserir Curso" widgetVar="insert" resizable="false" modal="true" width="600" height="500" hideEffect="clip" closeOnEscape="true" focus="enviar"&gt;
              &lt;h:panelGrid id="display" styleClass="col-lg-10 center"&gt;
                   &lt;label for="nome"&gt;Nome:&lt;/label&gt;
                   &lt;p:inputText styleClass="form-control adicionar" id="nome" value="#{cursoMBean.nome}" /&gt;
               &lt;/h:panelGrid&gt;
  
                  ...
  </code></pre>
  
  <p><strong>MBean:</strong></p>
  
  <pre><code>private String nome;
  
  public String getNome() {
      return nome;
  }
  
  public void setNome(String nome) {
      this.nome = nome;
  }
  </code></pre>
  
  <h2>Edit (new View):</h2>
  
  <pre><code>&lt;h:form id="inserirDisciplina"&gt;
      &lt;div class="form-group"&gt;
          &lt;div class="col-md-10"&gt;
              &lt;h:inputText styleClass="form-control" id="disciplina" value="#{cursoMBean.nome}" valueChangeListener="#{cursoMBean.atualizarListagemPesquisa}"&gt;
                  &lt;f:ajax event="keyup" render=":meuForm:minhaTabela" /&gt;
              &lt;/h:inputText&gt;
          &lt;/div&gt;
          &lt;div class="col-md-2"&gt;
              &lt;h:commandButton value="Adicionar" styleClass="btn btn-md btn-success" process="disciplina" partialSubmit="true"&gt;
                  &lt;p:ajax event="click" update=":meuForm:display" render=":meuForm:dialog" partialSubmit="true" process="disciplina" oncomplete="PF('insert').show();" onerror="alert('erro');" /&gt;
              &lt;/h:commandButton&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/h:form&gt;
  
  &lt;p:messages autoUpdate="true" /&gt;
  
  &lt;p:dialog id="dialog" header="Inserir Curso" widgetVar="insert"
                  resizable="false" modal="true" width="600" height="500"
                  hideEffect="clip" closeOnEscape="true"&gt;
  
  &lt;h:form&gt;
      &lt;h:panelGrid id="display" styleClass="col-lg-10 center" style="margin-top: 10px; margin-bottom: 15px;"&gt;
          &lt;label for="nome"&gt;Nome:&lt;/label&gt;
          &lt;p:inputText styleClass="form-control adicionar" id="nome" value="#{cursoMBean.nome}"&gt;
  
          &lt;/p:inputText&gt;
      &lt;/h:panelGrid&gt;
  
      &lt;h:panelGrid styleClass="col-lg-10 center"&gt;
          &lt;p:columnGroup&gt;
              &lt;label for="disciplinas"&gt;Disciplinas do Curso:&lt;/label&gt;
              &lt;h:selectManyCheckbox style="margin-bottom: 40px;" id="disciplinas" value="#{cursoMBean.listaDisciplinasDoCurso}" converter="omnifaces.SelectItemsConverter"&gt;
                  &lt;f:selectItems value="#{cursoMBean.listaTodasDisciplinas}" var="disciplina" itemValue="#{disciplina}" itemLabel="#{disciplina.nome}" /&gt;
              &lt;/h:selectManyCheckbox&gt;
          &lt;/p:columnGroup&gt;
      &lt;/h:panelGrid&gt;
  
      &lt;h:panelGrid styleClass="col-lg-10 center"&gt;
          &lt;p:columnGroup&gt;
              &lt;h:commandButton id="enviar" styleClass="btn btn-lg btn-success pull-right" value="Adicionar" action="#{cursoMBean.cadastrar}"&gt;
                      &lt;f:ajax event="click" execute="@form" onevent="insert.hide()" render=":meuForm:minhaTabela" listener="#{cursoMBean.cadastrar}" /&gt;
              &lt;/h:commandButton&gt;
          &lt;/p:columnGroup&gt;
      &lt;/h:panelGrid&gt;
  &lt;/h:form&gt;
  &lt;/p:dialog&gt;
  </code></pre>
  
  <p>What I'm doing wrong?</p>