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
值
您的'var'字段只能在'p:dataTable'內部訪問,因此'null'因爲它不在外面。它沒有'filterBy'嗎? – Geinmachi
它似乎過濾了數據表內的值。你能檢查嗎 –
非常感謝你問題是missing missingValue – whoami