You need to sign in to do that
Don't have an account?
pra.ax1478
Popup to display on Custom VF page is closed
Hello,
I am trying to add a logic to have the pop up dispalyed on the custom VF when it closes. I came to know that the popup display when the CF page is closed is out of box solution in salesforce.
I tried using the Java script onclick event with no luck & kind of lost. Can anyone who came across such requirement help me.
Thanks.
Have you tried the below code?
function doUnload()
{
if (window.event.clientX < 0 && window.event.clientY < 0)
{
alert("Window is closing...");
}
}
...
<body onunload="doUnload()">
I found it online in one fo the forums.
Hi S91084,
thanks for the reply. I tried the below but No Luck :( .
My exact logic is when people/user edit the VF page it opens up VF page in Edit mode (Which is Custom VF page). And the functionality to be added is when user click the 'X' (Not close button in the browser window...in this case close the Account/Opportunity Custom VF page) it should pop up saying "save something".
Try using the onbeforeunload event:
http://boards.developerforce.com/t5/Visualforce-Development/OnUnload-Event-for-a-visual-force-page/td-p/106019
Good luck!
This is woking for the command button & IE/mozilla browser close to display the pop up. I am mainly looking for the pop up to display when I close the custom VF page tab. Using firebug, I figured out that it uses an anchor tag which has the class name & Id (ID is randomly generated) as attributes. Can you please let me know how do i map it in my custom page javascript to cal it. It is weird that the anchor tag doesnt have href or Id (as common name) to call.