2015-10-21 53 views
1

過濾後filterBy選中var實例丟失​​。後primefaces過濾器選擇var丟失

<p:dataTable id="searchResults" 
      var="searchResult" 
      value="#{employeeController.searchResults}" 
      selectionMode="single" 
      selection="#{employeeController.selectedEmployee}" 
      rowKey="#{searchResult.id}"> 
    <p:column headerText="Employee Name" 
       filterBy="#{searchResult.name}" 
       sortBy="#{searchResult.name}"> 
     <h:outputText value="#{searchResult.name}"/> 
    </p:column> 
</p:dataTable> 


<p:commandButton actionListener="#{employeeController.editEmployee(searchResult)}" 
       icon="ui-icon-pencil" 
       title="Güncelle" ajax="true" update="@form"> 

我的事件沒有得到所選searchResult實例而是一個null

+0

您的'var'字段只能在'p:dataTable'內部訪問,因此'null'因爲它不在外面。它沒有'filterBy'嗎? – Geinmachi

+0

它似乎過濾了數據表內的值。你能檢查嗎 –

+0

非常感謝你問題是missing missingValue – whoami

回答

1

我解決了這個問題。我只是缺少filteredValue