Jsf 2 Richfaces 4重置分页
目标:当用户进行新搜索时,我想将分页重置为第1页 代码: 当前行为:搜索,转到第2页,第2页显示。进行新的搜索,页码显示为1,但表中显示了第2页的数据。(将每页的行数限制为20行,总行数限制为25行,因此很容易判断) 预期行为:应将页面重置为1,并显示第一个结果Jsf 2 Richfaces 4重置分页,jsf-2,richfaces,seam2,Jsf 2,Richfaces,Seam2,目标:当用户进行新搜索时,我想将分页重置为第1页 代码: 当前行为:搜索,转到第2页,第2页显示。进行新的搜索,页码显示为1,但表中显示了第2页的数据。(将每页的行数限制为20行,总行数限制为25行,因此很容易判断) 预期行为:应将页面重置为1,并显示第一个结果 据我所知,这在RichFaces3.3中是有效的,但在4.2中并没有达到预期的效果。如果能提供任何帮助,我们将不胜感激。找到了使用第一个API的方法。有点烦人,它显示第一页的结果,然后重新发布新的结果,但总比不工作好 searchPan
据我所知,这在RichFaces3.3中是有效的,但在4.2中并没有达到预期的效果。如果能提供任何帮助,我们将不胜感激。找到了使用第一个API的方法。有点烦人,它显示第一页的结果,然后重新发布新的结果,但总比不工作好
searchPanel.xhtml
<a:commandButton action="#{SearchAction.performSearch()}"
onbegin="#{rich:component('waitPanel')}.show()"
onbeforedomupdate="#{rich:component('waitPanel')}.hide()"
onclick="#{rich:component('scroller')}.first()
render=searchResultsTable scroller"/>
searchPanel.xhtml
<!-- headers and other stuff -->
<h:commandButton actionListener="#{SearchAction.resetPage}"
action="#{SearchAction.performSearch}" />
private int currentPage;
private int firstResult;
public void performSearch()
{
//do search stuff
}
public void resetPage()
{
setCurrentPage( 1 );
setFirstResult( 0 );
}
//Getters and Setters
searchPanel.xhtml
<a:commandButton action="#{SearchAction.performSearch()}"
onbegin="#{rich:component('waitPanel')}.show()"
onbeforedomupdate="#{rich:component('waitPanel')}.hide()"
onclick="#{rich:component('scroller')}.first()
render=searchResultsTable scroller"/>