我有一个搜索查询,在用户点击下一个按钮时运行。这在查询运行等时非常有效。唯一的事情是当用户进入下一页时,panelGrid
中没有任何内容。我怎么能克服这个?
控制器:
UserTableController
(按下下一个按钮后运行)
private String search;
private List<Usertable> item; // No need for DataModel here.
public List<Usertable> getItem() {
return item;
}
public String submit() {
item = ejbFacade.searchByString(search);
return "View.xhtml"; //change this !, testing only
}
public String getSearch() {
return search;
}
public void setSearch(String search) {
this.search = search;
}
观点:
<p:dataTable id="UserTableSearch"
widgetVar="UserTableSearch"
paginator="true" rows="10"
value="#{usertableController.item}"
var="item"
emptyMessage="No details was found with given criteria">
<p:column id="username"
headerText="username"
sortBy="username">
<f:facet name="header">
<h:outputText value="username"/>
</f:facet>
<h:outputText value="#{item.username}"/>
</p:column>
</p:dataTable>
如何使用这些信息在下一页填充数据表格的panelGrid?