在多个窗口中 Xpages 相同的文档 [英] Xpages same document in multiple windows

查看:28
本文介绍了在多个窗口中 Xpages 相同的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们关注的 XPage 应用程序中,用户长期以来一直在使用它时抱怨数据丢失".他们的意思是,当他们提交文档时,他们有时会刷新页面并且他们刚刚编辑的所有字段都是空白的,或者处于原始页面加载时的状态,因此他们经历了数据丢失.花了很多时间来弄清楚发生了什么,他们现在执行的每一个操作都被记录在文档中,所以我可以查看它.我们发现了正在发生的事情,我需要找到解决方法:

In an XPage application we look after, users have long been complaining of "data loss" at random times when using it. By this they mean that when they submit the document they sometimes have the page refresh and all the fields they have just edited are blank, or in the state at the time of original page load and so they have experienced Data Loss. It has taken a lot of time to work out what is going on, with every action they perform now being logged in documents so I can review it. We found out what is happening and I need to work out a way around it:

  1. 在 Chrome/IE 的窗口 1 中打开文档 - 浏览器并不重要.
  2. 在浏览器中打开另一个窗口并在应用中搜索相同的文档,打开它(默认以阅读模式打开)
  3. 文档有多个选项卡,因为有很多信息 - 用户转到他们想要从窗口 2 中的只读副本上复制信息的选项卡
  4. 然后用户开始在窗口 1 中的可编辑版本中输入信息 - 他们想要引用位于另一个选项卡式面板上的文档部分,因此将其打开到窗口中.
  5. 用户提交他们的更改.不幸的是,因为他们在另一个窗口中打开了文档,然后单击了其中一个选项卡式面板以打开它的另一部分,可编辑版本实际上与服务器内存中的上下文无关(我假设)-更改丢失了在提交时,用户需要重新输入.

如果他们打开只读版本并且不浏览选项卡式面板,他们可以继续在可编辑版本中正常工作.似乎提交文档,即使它处于阅读模式,也会破坏可编辑版本与服务器的链接.为什么会这样,如何预防?

If they open the read only version and don't navigate around the tabbed panels, they can continue working in the editable version just fine. It seems that the submission of the document, even when it's in read mode, breaks the link that the editable version has with the server. Why is this and how can it be prevented?

我想阻止他们在另一个窗口中打开它(虽然不确定如何)作为绝对的最后手段 - 它已成为许多国家/地区的许多用户的一种工作方式.有任何想法吗??

I would want to prevent them opening it in another window (not sure how though) as an absolute last resort - it's become a way of working for many users in many countries. Any ideas??

应要求提供更多信息:好的,所以文档是问题报告.第一个选项卡上有关调用者、受影响模型等的基本详细信息.有一个附件选项卡,其中还有一个解决方案选项卡.

Some more info as requested: Ok so the documents are problem reports. Basic details about the caller, model affected and such on the first tab. There is an attachments tab, and among others, there is a solution tab.

在识别用户在做什么时,他基本上是说因为他记不起调用者的名字,想把解决方案发给调用者,他在另一个窗口中打开了文档.看起来有点懒,但无论如何.

When identifying what the user was doing, he basically said that because he couldn't remember the caller's name and wanted to address the solution to the caller, he opened the document in another window. Seems a bit lazy but anyway.

一个叫 John Mackay 的人发表了一篇文章,我想一段时间前关于跟踪使用 sessionScope 变量选择的选项卡,我出于几个原因使用了该变量.因此,选项卡的 onclick 事件将 sessionScope.tabSelected var 设置为所选的任何内容.当我对文档进行完整更新时,这会有所帮助,因为该人最后使用的选项卡是刷新后默认选择的选项卡.因此,当用户在另一个窗口中打开文档时, sessionscope 变量也会导致在那里打开相同的选项卡.

There was a post by a guy called John Mackay I think some time ago about keeping track of the tab that was selected with a sessionScope variable that I am using for a couple of reasons. The onclick event of the tabs therefore sets the sessionScope.tabSelected var to whatever is selected. This helps when I do a full update on the document, in that the tab the person was last on is the one that is selected by default after the refresh. So when the user opens the document in another window, the sessionscope var causes the same tab to open there too.

如果用户在解决方案"选项卡上并且他们在另一个窗口中打开文档,则解决方案选项卡也会被选中.然后,他们必须选择信息"选项卡才能找到来电者的姓名,这就是导致问题的原因.也许范围较小的 var 可以解决它?我已经尝试过使用 onclick 进行不更新或验证"和部分执行"设置,但这并没有解决.当我明天回到办公室时,我将在不设置范围变量的情况下尝试使用选项卡点击,看看这是否解决了任何问题,并将报告

If the user is on the "Solution" tab and they open the doc in another window, the solution tab is also selected. They then have to select the "Information" tab to go and find the caller's name and it's this that causes the problem. Maybe a var with a lesser scope may fix it? I have tried "Do Not update or validate" and "Partial execution" settings with the onclick but that hasn't fixed it. I am going to try it without setting scoped vars on the tab clicks when I'm back in the office tomorrow to see if this fixes anything and will report back

推荐答案

已解决!我有一个选项卡式面板,在定义中,我有:

Solved! I had a tabbed panel and in the definition, I had :

selectedTab="#{javascript:sessionScope.TabSelected}"

在每个选项卡上,我都有一个可以设置 sessionScope.TabSelected 的事件处理程序.我尝试了部分执行模式,我尝试了不验证或更新数据,但没有任何效果.

On each of the tabs, I had an event handler that would set sessionScope.TabSelected. I tried Partial Execution Mode, I tried Do Not Validate or Update Data but nothing worked.

然后我完全删除了每个选项卡上的事件处理程序以及 selectedTab 属性.现在您可以在一个窗口中打开编辑中的文档,然后在另一个窗口中阅读,在阅读版本中单击选项卡,它不会影响可编辑窗口中的文档.提交可编辑的版本,它没有被服务器拒绝,这正是我想要的.

Then I removed the event handler completely on each tab and also the selectedTab property. Now you can open the document in edit in 1 window, and read in another, click tabs in the read version and it doesn't affect the document in the editable window. Submit the editable version and it's not rejected by the server which is exactly what I want.

唯一的缺点是,如果您现在对文档执行完整更新并重新加载页面,它会返回选项卡式面板中的第一个选项卡,而不是您所在的位置.我希望这会被用户接受!

The only downside is that if you perform a full update on the document now and the page reloads, it goes back to the first tab in the tabbed panel instead of where you were. I'm hoping this will be acceptable by the users!

这篇关于在多个窗口中 Xpages 相同的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆