title: p:datatable select row listener not working
body: <p>Initially a button is disabled, and I want it to get enabled when I select a row in the datatable, but the listener is not working and I can't find the problem...</p>
  
  <p>This is how the xhtml file looks like:</p>
  
  <pre><code>&lt;h:form id="form" class="formulario"&gt;
          ...
          &lt;p:dataTable value="#{queryBean.offs}" var="offer" selection="#{queryBean.oferta}" rowKey="#{offer.offerNumber}" tableStyle="width:auto" &gt;
                  &lt;f:facet name="header"&gt;Ofertas disponibles&lt;/f:facet&gt;
  
                  &lt;p:ajax event="rowSelect" listener="#{queryBean.rowSelected}" /&gt;
  
                  ...
  
          &lt;/p:dataTable&gt;
  
              &lt;center&gt;&lt;br/&gt;
              &lt;h:commandButton id="botonReserva" value="Reservar" disabled="true" &gt;
                  &lt;p:ajax process="form" update="form" resetValues="true" /&gt;
              &lt;/h:commandButton&gt;
  
                  ...
              &lt;/center&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>And this is the bean's listener</p>
  
  <pre><code>...
  
  public void rowSelected(SelectEvent selectEvent) {
      System.out.println("Working");
      //Not printing anything
  }
  
  ...
  </code></pre>
  
  <p>I know I'm not updating the button but it is because it doesn't work, so first I want to know how to solve this. After I solve the problem I would know how to enable the button.</p>
  
  <p>What could be the problem?</p>
  
  <p>SOLUTION: It was because I was using a datatable with radio buttons, and I should have used <code>event="rowSelectRadio"</code> instead of <code>event="rowSelect"</code></p>