我想在我的页面中同时使用上下文菜单和过滤器,但在我过滤并重新加载页面后,我得到了这个异常
启用选择时,DataModel必须实现org.primefaces.model.SelectableDataModel。
<p:dataTable
id="wtmInbox"
rendered="#{flowDashboardManagedBean.renderOnLoadForWtm}"
value="#{flowDashboardManagedBean.worktimematrixList}"
var="wtms"
stickyHeader="false"
tableStyleClass="IEListTable"
widgetVar="wtmInboxWidVar"
scrollable="true"
scrollHeight="700"
editable="true" rowKey="#{wtms.worktimematrix.workTimeMatrixId}" selection="#{flowDashboardManagedBean.selectedWorktimematrix}" selectionMode="single">
<p:ajax event="rowEdit" listener="#{flowDashboardManagedBean.onRowEdit}" update="wtmInbox"/>
<p:ajax event="contextMenu" listener="#{flowDashboardManagedBean.onRowSelect}" ></p:ajax>
过滤器:
<p:column headerText="#{bundle.status}"
sortBy="#{wtms.worktimematrix.workTimeMatrixStatus.name}"
filterBy="#{wtms.worktimematrix.workTimeMatrixStatus.name}"
filterMatchMode="exact"
style="text-align:right;"
priority="1"
width="10%">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{wtms.worktimematrix.workTimeMatrixStatus}" converter="workTimeMatrixStatusConverter"></h:outputText>
</f:facet>
<f:facet name="input">
<p:selectOneMenu value="#{wtms.worktimematrix.workTimeMatrixStatus}" converter="workTimeMatrixStatusConverter">
<f:selectItem itemLabel="#{bundle.select}" itemValue="#{null}"/>
<f:selectItems value="#{flowDashboardManagedBean.workTimeMatrixStatuses}" var="worktimematrixStatus" itemValue="#{worktimematrixStatus}" itemLabel="#{worktimematrixStatus.name}"></f:selectItems>
</p:selectOneMenu>
</f:facet>
</p:cellEditor>
<f:facet name="filter">
<p:selectOneMenu onchange="PF('wtmInboxWidVar').filter()" id="flowModelTypeFilter">
<f:selectItem itemLabel="#{bundle.status}" itemValue="#{null}" noSelectionOption="true" />
<f:selectItems value="#{flowDashboardManagedBean.workTimeMatrixStatusNames}" var="status" itemValue="#{status}"/>
</p:selectOneMenu>
</f:facet>
</p:column>
答案 0 :(得分:0)
发现问题,表后面的实体没有实现可序列化。在我添加了过滤器工作之后,当我在上下文菜单中添加它时,它也起作用。