Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 Richfaces 4重置分页_Jsf 2_Richfaces_Seam2 - Fatal编程技术网

Jsf 2 Richfaces 4重置分页

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

目标:当用户进行新搜索时,我想将分页重置为第1页

代码:

当前行为:搜索,转到第2页,第2页显示。进行新的搜索,页码显示为1,但表中显示了第2页的数据。(将每页的行数限制为20行,总行数限制为25行,因此很容易判断)

预期行为:应将页面重置为1,并显示第一个结果


据我所知,这在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"/>