title: p:dialog does not fire ajax close event when using dialog.hide()
body: <p>I'm using <code>&lt;p:dialog&gt;</code>. After submitting the form therein, I use <code>dialog.hide()</code> and it fires the ajax close event listener method which will update a <code>List&lt;E&gt;</code>.
  It was working properly, but when I put some required input components and bring the <code>&lt;p:dialog&gt;</code> again if there is some validation error, it doens't fire the method anymore.</p>
  
  <p>The dialog:</p>
  
  <pre><code>&lt;p:outputPanel autoUpdate="true"&gt;
      &lt;p:dialog id="dialogComentario" header="Deixe sua avaliação" widgetVar="confirmation" 
          showEffect="fade" hideEffect="fade" height="340" width="500" modal="true" 
          visible="#{not empty facesContext.maximumSeverity}" 
          resizable="false" closable="true" draggable="false"&gt;
          &lt;h:form prependId="false"&gt;
              ...
              &lt;p:commandLink styleClass="btn btn-primary btenviacoment" 
                  oncomplete="if (!args.validationFailed) confirmation.hide();" 
                  actionListener="#{comentario.actEnviarComentario}" global="false"&gt;
                  &lt;i class=" icon-play-circle icon-white"&gt;&lt;/i&gt;
                  &lt;h:outputText value=" Enviar Comentário" /&gt;
                  &lt;f:param name="codigoplu" value="#{produto.produto.codigoplu}" /&gt;
              &lt;/p:commandLink&gt;
              ...
              &lt;p:commandLink styleClass="btn" onclick="confirmation.hide();" 
                  global="false" immediate="true"&gt;
                  &lt;h:outputText value=" Cancelar" /&gt;
                  &lt;i class="icon-off"&gt;&lt;/i&gt;
              &lt;/p:commandLink&gt;
              ...
          &lt;/h:form&gt;
          &lt;p:ajax event="close" update=":avaliacoesClientes, :dialogComment" 
              listener="#{produto.atualizarComentarios}" global="false" /&gt;
      &lt;/p:dialog&gt;
  &lt;/p:outputPanel&gt;
  </code></pre>
  
  <p>The action listener method:</p>
  
  <pre><code>public void actEnviarComentario(ActionEvent event) {
      String codigoplu = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("codigoplu");
      PegarDadosCliente();
  
      try {
          DateFormat f = new SimpleDateFormat("dd/MM/yyyy");
          java.util.Date utildata = new java.util.Date();
          utildata = (java.util.Date) f.parse(String.valueOf(data.getValue()));
          java.sql.Date datasql = new java.sql.Date(utildata.getTime());
  
          Comentario comentario = new Comentario(Integer.parseInt(usuario.getId()), Integer.parseInt(codigoplu), titulo.getValue().toString(), mensagem.getValue().toString(), datasql, Integer.parseInt(rating.getValue().toString()), new java.sql.Date(new Date().getTime()));
          listavelComentarios.inserirComentario(comentario);
  
          RequestContext.getCurrentInstance().execute("confirmation.hide();");
      } catch (NamingException e) {
          e.printStackTrace();
      } catch (SQLException e) {
          e.printStackTrace();
      } catch (ParseException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>I tried to close the dialog with <code>RequestContext</code> as shown in action method, but that won't fire the ajax close event either.</p>
  
  <p>Here's the ajax close event listener method:</p>
  
  <pre><code>public void atualizarComentarios(CloseEvent event) {
  
      try {
          comentarios = comentario.listarComentarios(codigoplu);
  
          if (comentarios.size() &gt; 0) {
              msgAvaliacao = "Avaliação do produto.";
              int votos = 0;
  
              for (Comentario comentario : comentarios) {
                  votos += comentario.getAvaliacao();
              }
  
              rating = votos / comentarios.size();
          }
      } catch (NamingException e) {
          e.printStackTrace();
      } catch (SQLException e) {
          e.printStackTrace();
      }
  }
  </code></pre>