除了当我在任何页码(比如说 5)上并执行搜索操作(或任何呈现 dataTable 的操作)时,我的工作都很好rich:datascroller
。rich:dataTable
分页仍会显示第 5 页,但我希望在操作发生时将其重置为 1. 页。
在这张图片中,当我要转到第 5 页并再次点击搜索或清除并再次搜索时,分页仍设置为第 5 页,而不是回到第 1 页。
这是我的代码片段:
<rich:datascroller id="prodDataScroller" for="prodClassificationOutputTable"
rows="100" maxPages="10" fastStep="3" renderIfSinglePage="false"
immediate="false" page="#{prodClassificationBean.firstPage}">
</rich:datascroller>
<rich:dataTable id="prodClassificationOutputTable" border="0"
width="100%" columnClasses="col" headerClass="column-header"
style="overflow:auto;" rowClasses="odd,even" align="center"
value="#{prodClassificationBean.outputClassificationWrappers}"
var="prodClassificationRow" rows="100" rowKeyVar="row" immediate="true">
<!-- ... -->
<rich:dataTable>
我检查了其他解决方案。我试图page
为 datascroller 实现属性,但它似乎不起作用。当搜索发生时,我在支持 bean 中创建了一个属性firstpage
,将其设置为“1”,这样 datascroller 的页面属性的值为 1。但这并没有解决问题。
我想知道我哪里出错了。