经过primefaces过滤后,所选变量丢失



filterBy筛选后,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

我解决了这个问题。我刚好漏掉了filteredValue

最新更新