【发布时间】:2016-06-02 17:45:17
【问题描述】:
我的rich:dataTable 有rich:datascroller,它运行良好,除了当我在任何页码(比如说5)上并执行搜索操作(或呈现数据表的任何操作)时。分页仍会显示第 5 页,但我希望在操作发生时将其重置为 1. 页。
在这个image中,当我要去第5页并再次点击搜索或清除并再次搜索时,分页仍然设置为第5页,而不是回到第1页。
这是我的代码 sn-p:
<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>
我检查了其他解决方案。我尝试为 datascroller 实现 page 属性,但它似乎不起作用。我在支持 bean 中创建了一个属性 firstpage,当搜索发生时将其设置为“1”,这样 datascroller 的页面属性的值为 1。但这并没有解决问题。
我想知道我哪里出错了。
【问题讨论】:
-
我尝试了 developer.jboss.org/thread/10566?start=0&tstart=0 的解决方案,但没有任何效果
-
1.这不是错误。 2. 您在 jboss 论坛上写道“没有任何效果”,但您在此处粘贴了“an answer”,这是那里的第三个答案。
标签: jsf pagination richfaces datascroller