How do I close my window in Xpage?

后端 未结 5 630
死守一世寂寞
死守一世寂寞 2020-12-21 06:46

Actually I am using the following code for closing my current window:

window.close()

The thing is, it is working fine in IE, but it is not

5条回答
  •  囚心锁ツ
    2020-12-21 07:09

    I use window.close with no problems in 8.5.3 apps with Chrome / FF / IE.

    In the main page of an app, the "Case Document" I have some CSJS at the top that names the page ie.

    window.name="mainWindow";
    

    and then I have a button that allows you to ask a question - this pops up a new window/tab and keeps the main case doc open as well. In the new window, there's a submit button that does a full update and in the onComplete event I have the following CSJS to update the main doc so you can see the question on the main doc in the repeat control that shows the threads of Q & A docs:

        if (window.opener!=null){
            window.opener.location.href = window.opener.location.href; 
            window.close();}
        else {
            alert("Can't refresh parent case doc - have you closed the window?");
        }
    

    Hope this helps

提交回复
热议问题