Search code examples
javascriptxpagesxpinc

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


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.


Solution

  • 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.