How to close xpages in notes client? I use CSJS window.close but it's not working

醉酒当歌 提交于 2019-12-01 07:42:31

问题


I'm doing an xpinc application.

I followed the example in here and modified it. Currently the close button is on my main page.

The customer wanted a close button instead of the normal 'X' to close. But the example suggests that I should create 2 xpages.

On page1 I should create a button with window.open(xpage2.xsp) and only then window.close() in a button in xpage2 will work. How do I window.close() when I have no window.open() to begin with?

I've check Demo Discussion xpage and OneUI but there's nothing like that. I tried putting window.open(xpage1.xsp) on xpage1 onClientLoad event but that's not working too.


回答1:


Only if the page is opened by window.open, then window.close works fine. otherwise it does not work. Please see the following question, same question has already appeared in stackoverflow.

How to close the xpages?

For my project, I redirected the page into my home page.

And I am also searching the fine solution for this problem.




回答2:


I had the same problem today and found this very interesting article by Fredrik Norling, which helped: http://www.xpagedeveloper.com/2013/ibm-notes-domino-9-01-xpages-fixlist

There is a new notes.ini (client) parameter:

XPagesXulAllowScriptsToCloseWindows=1

together with the SSJS code

view.postScript("window.close()");

worked for me - the tab / window in the Notes Client could be closed from the XPage.

Strange thing that we have to add this parameter, maybe it has something to do with security...



来源:https://stackoverflow.com/questions/11093639/how-to-close-xpages-in-notes-client-i-use-csjs-window-close-but-its-not-workin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!