本文介绍了如何保存重复控件的状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于视图生成的重复控件.
当用户导航到文档并返回时,我想保存重复控件的状态.
我已经尝试了 ExtLib 中的寻呼机保存状态控件,但它不起作用.

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.

请指教!

推荐答案

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

I dont know if the xe:pagerSaveState should work with the repeat control. I always use the xe:pagerSaveState in combination with a View/DataView/ForumView. But when useing a reapeat i do something like this to get my state back:

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

When opening the 'EditYourDocument.xsp' XPage write the first element of the xp:repeat control to a scope like:

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

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

and add this code to your repteat:

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

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

when comming back to your view from any other site your view should display to the right page and data.

这篇关于如何保存重复控件的状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 01:01