title: Richfaces 3.3 extendedDataTable onRowClick is setting data from previous row click
body: <p>I have this datatable with an a4j:support tag so taht when someone clicks on a row, i want to display or hide certain buttons based on the status of the row selected.</p>
  
  <p>The problem is that the data in my backing bean is always one click behind. </p>
  
  <pre><code>&lt;rich:extendedDataTable
      id="formSummaryTableId"
      var="dataSummary"
      value="#{FormSearch.summaries}"
      binding="#{FormBacking.table}"
      selection="#{FormSearch.selection}"
      rowKeyVar="rkv"
      frozenColCount="0"
      sortMode="single" height="500px" width="795px"
      cellpadding="0" cellspacing="0" border="0" rowClasses="even, odd"
      selectedClass="itemSelected"&gt;
  
      &lt;a4j:support event="onRowClick" actionListener="#{FormBacking.onClickForm}"
          reRender="DesignerForm:formEditToolbar" /&gt;
  ....
  </code></pre>
  
  <p>FormBacking.onClickForm</p>
  
  <pre><code>public void onClickForm(ActionEvent e) 
  {
      Iterator&lt;Object&gt; selectionKeys = getFormSearch().getSelection().getKeys();
      LOG.info("selectionKeys = "+selectionKeys.hasNext());
      if (selectionKeys.hasNext())
      {
          LOG.info("selectionKeys.next()");
          Integer lookupKey = (Integer) selectionKeys.next();
          LOG.info("lookupKey = "+lookupKey);
      } else {
          LOG.info("THERE is no keys");
      }
  }
  </code></pre>
  
  <p><strong>EDIT</strong> </p>
  
  <p>I've figured out that for some reason, when i click a row, it's not getting set correctly. It's like it's 1 step behind my clicks. For example if i click row 1 of my datatable, my method gets into "THERE is no keys", but if i click row 2 now, my method has the keys for the first row I clicked. </p>
  
  <p>Why is it 1 click behind?</p>