title: primefaces messages not displayed
body: <p>I got a page with a single_selection datatable and a commandbutton. The commandbutton invokes a bean method that verifies if a selection was made. If not it should display a message warning the user. If a selection was made it navigates to another page.</p>
  
  <p>The problem is that no message is displayed when there's no selection. If a selection was made it works fine.</p>
  
  <p>Here's the code for the page:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:body&gt;
  &lt;h:form id="form"&gt;
  &lt;p:dataTable id="TablaSociedades" var="soc" value="#{Sesion.tablaSociedades}" emptyMessage="No hay Registros que Mostrar" selection="#{Sesion.sociedadUsuario}"&gt;  
    &lt;f:facet name="header"&gt;Sociedades asociadas al Usuario&lt;/f:facet&gt; 
       &lt;p:column selectionMode="single" style="width:18px" /&gt;  
       &lt;p:column&gt;
          &lt;f:facet name="header"&gt;
             &lt;h:outputText value="Sociedad" /&gt;
          &lt;/f:facet&gt;
             &lt;h:outputText value="#{soc.nombreSociedad}" /&gt;
       &lt;/p:column&gt;
    &lt;f:facet name="footer"&gt;  
       &lt;p:commandButton action="#{Sesion.mostrarMenu()}" value="Continuar" process=":form" /&gt;  
     &lt;/f:facet&gt; 
  &lt;/p:dataTable&gt;
  &lt;br/&gt;
  &lt;div&gt;
    &lt;p:messages id="messages2" showDetail="true" autoUpdate="false" closable="true" /&gt; 
  &lt;/div&gt;
  &lt;/h:form&gt;
  &lt;/h:body&gt;
  </code></pre>
  
  <p>And the code for the bean method:</p>
  
  <pre class="lang-java prettyprint-override"><code>  public boolean mostrarMenu()
  {
      boolean resp = true;
  
      if (sociedadUsuario.getNombreSociedad().equals("")) //no selection
      {
          FacesContext.getCurrentInstance().addMessage(null, new FacesMessage  (FacesMessage.SEVERITY_WARN,"Seleccione una Sociedad", "No puede Continuar"));  
          resp = false;
      }
  
      return resp;
  }
  </code></pre>
  
  <p>I must mention that the commandbutton must be clicked twice but i'll post another question for that problem.</p>
  
  <p>I did another page with bean validation where the messages are displayed correctly, the only difference with this page is that the other page contains only inputText, commandbutton and messages.</p>
  
  <p>Thanks for your time</p>
  
  <p>02/25/13 Code for the faces-config.xml file. </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;navigation-rule&gt;
     &lt;from-view-id&gt;/elegirSociedad.xhtml&lt;/from-view-id&gt;
     &lt;navigation-case&gt;
      &lt;from-action&gt;#{Sesion.mostrarMenu()}&lt;/from-action&gt;
      &lt;from-outcome&gt;true&lt;/from-outcome&gt;
      &lt;to-view-id&gt;/principal.xhtml&lt;/to-view-id&gt;
      &lt;redirect /&gt;
     &lt;/navigation-case&gt; 
  &lt;/navigation-rule&gt;
  </code></pre>
  
  <p>I used redirect to avoid the "click twice" problem that i comment before but to no avail</p>