1

I have a repeat control generated based on a view.
I'd like to save the state of the repeat control when a user navigates to a document and returns.
I have tried the pager Save State control from ExtLib but that doesn't work.

Please advice!

4

1 回答 1

4

我不知道是否xe:pagerSaveState应该与重复控制一起使用。我总是将它xe:pagerSaveState与 View/DataView/ForumView 结合使用。但是当使用重复时,我会做这样的事情来恢复我的状态:

打开“EditYourDocument.xsp”XPage 时,将xp:repeat控件的第一个元素写入如下范围:

sessionScope.put('first',getComponent("repeat1").first);
context.redirectToPage("editDocument.xsp");

并将此代码添加到您的重复中:

first="#{javascript:return (sessionScope.first != null)?sessionScope.first:0;}">

当从任何其他站点返回您的视图时,您的视图应显示到正确的页面和数据。

于 2013-06-13T11:36:05.510 回答