title: p:datatable selection null
body: <p>I'm trying to use selectable datatable of primefaces 4.0, but the selected object is always null.
  I have tired add <code>rowKey</code> like <a href="https://stackoverflow.com/questions/10208091/primefaces-datatable-selection-goes-null-on-dialog-show">here</a> and <a href="https://stackoverflow.com/questions/12206844/primefaces-datatable-selection-object">here</a> said, but still get null...</p>
  
  <p>here's my <strong>page</strong>:</p>
  
  <pre><code>&lt;p:dataTable id="appDetailTable" var="appDetail"  value="#{newAppraiseBean.appDetailDataModel}"  
               paginator="true" rows="5" paginatorPosition="bottom" selection="#{newAppraiseBean.selectedAppDetail}" 
               rowKey="#{appDetail.appraiseDetailID}" selectionMode="single"&gt;
    &lt;p:ajax event="rowSelect" listener="#{newAppraiseBean.modifyAppDetail()}" oncomplete="newAppDlg.show();" update=":newAppraiseForm:newAppDetail"/&gt;   
  &lt;/p:dataTable&gt;
  </code></pre>
  
  <p>In my backing bean:  </p>
  
  <p><strong>newAppraiseBean.modifyAppDetail():</strong>  (Just print the selected item)</p>
  
  <pre><code>public void modifyAppDetail(){
      System.out.println("modify, selectedAppDetail:"+selectedAppDetail);
  }
  </code></pre>
  
  <p><strong>DataModel:</strong>  </p>
  
  <pre><code>private class AppraiseDetailDataModel extends ListDataModel&lt;Appraisedetail&gt; implements SelectableDataModel&lt;Appraisedetail&gt; {
  
      public AppraiseDetailDataModel(List&lt;Appraisedetail&gt; list) {
          super(list);
      }
  
      @Override
      public Object getRowKey(Appraisedetail t) {
          return t.getAppraiseDetailID();
      }
  
      @Override
      public Appraisedetail getRowData(String string) {
          List&lt;Appraisedetail&gt; appList=(List&lt;Appraisedetail&gt;) getWrappedData();
          for(Appraisedetail app:appList){
              System.out.println(app.getAppraiseDetailID());
              if(app.getAppraiseDetailID()==Integer.parseInt(string)){
                  return app;
              }
          }
          return null;
      }
  
  }
  </code></pre>
  
  <p>It always print null and I don't know what am I missing.  </p>
  
  <h2><strong>Update</strong></h2>
  
  <p>I have simplified my code and put it on <a href="https://drive.google.com/file/d/0B5ye4CP3K_a3blBnbVk3cmNjMEE/edit?usp=sharing" rel="nofollow noreferrer">google drive</a>.<br>
  This is an zipped file of netbean project, you may open it directly with netbean after unzip it.<br>
  And of course the problem remains after I simplify my code. </p>