cancel
Showing results for 
Search instead for 
Did you mean: 

how to handle on window.close()

Former Member
0 Kudos

Hello.

I have a requirement where a user (say manager) has a facility to see the details of his employee. THe problem which i am facing is

If a user (employee or line manager) has opened a PEP form and he is closing the browser without the log off functionality, the PEP form needs to be unlocked.

If the manager has more than one PEP form open, all forms need to be unlocked.

I have the a method in place to unlock the PEP records but how can i capture the window close event?

Thanks

RK

Accepted Solutions (0)

Answers (3)

Answers (3)

RieSe
Contributor
0 Kudos

Hi,

if you use the windows.close method as posted, you will get a confirmation dialog.

If you don't want this use:

window.opener=''; window.close(); instead.

Regards, Stefan

Former Member
0 Kudos

Hi,

You are capturing the event with onclick, jst mention that onclick in script as a function.

Here is a sample code:

< script language="JavaScript">
    function function1() { //here function1 is onclick of button)
        javascript:self.close();
    }
< /script>


<button id="myButton1" on click="function1();">Button One</button>

Hope this solves the issue,Let me know if any queries.

Regards,

Rajani

Former Member
0 Kudos

Hi Rajani...

From your post i could understand that you are capturing the event of the BSP page...

My question is that if i close the Intenet explorer window in which the form is displayed, a corresponding event has to be captured so that I can call my method.

Please let me know a solution for the same.

Thanks

RK

athavanraja
Active Contributor
0 Kudos

check out these weblogs

/people/eddy.declercq/blog/2006/03/27/why-do-you-leave-me-this-way

/people/eddy.declercq/blog/2006/03/20/wake-me-up-before-you-go-go

Former Member
0 Kudos

Hi,

You can achieve it by using javscript.

Here is a sample code to close the window

javascript:self.close();

Hope this helps you, Let me know if any queries.

Regards,

Rajani

Former Member
0 Kudos

HI Rajani ...

Thanks for your reply. Let me put my scenario.

I have a method in OnInputProcessing which is for unlocking the PEP records.

So how can i link the java script which u have given to the above said method.

Thakns

Rk