给定以下primefaces数据
<p:dataTable value="#{cc.attributes.playerCollection}" var="player"
widgetVar="playerWidgetTable" emptyMessage="#{uimsg.ui_not_recordsfound}">
<!-- filter event handler -->
<p:ajax event="filter" listener="#{cc.attributes.viewBean.listenFilter}" update="@this"/>
<!-- Player first name -->
<p:column id="firstnameColumn" headerText="#{uimsg.firstname}"
filterBy="#{player.firstName}" filterMatchMode="contains">
<h:outputText value="#{player.firstName}" />
</p:column>
</p:dataTable>
某人如何(在服务器端)获得用户在过滤器文本列中给出的过滤器“文本”值?
我试图用“listenFilter”收听过滤器事件:
@ManagedBean
@ViewScoped
public class PlayerListBean implements Serializable {
......
public void listenFilter(FilterEvent event) {
// update datasource
Map<String, String> tempString = event.getFilters();
System.out.println("size filter: "+ tempString.size());
for (String key : tempString.keySet()) {
System.out.println("key: " + key + " \t values: "
+ tempString.get(key));
}
}
}
但我不能从它开始。他们还有其他选择吗?喜欢将 DataTable 作为绑定组件使用,或者?
谢谢