Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
royster

Senior Member
Registered:
Posts: 74
Reply with quote  #1 

Hello
I have searched for this but no-one seems to have brought this up

I have put the following code into the "When form cancelled" javascript event

return confirm("You may lose unsaved data by closing the form this way. Click Ok to proceed or click Cancel to return to the form.");

When one clicks the Cancel button, the script gets run, and you have the choice to cancel and return to the form in action mode, or you can cancel the action, altogether. When one clicks the browser close button, X in the top right, the action form closes, then the message gets displayed. Regardless of whether you click Ok or Cancel, the form is already lost.

This looks like a bit of a bug to me?

 

 

0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #2 
The similar has existed since at least BPM V6.
I suspect its because the X is a windows close which BPM doesn't catch.  I know in our V6/7 process we override the cancel with a similar message, but have an extra check displaying a different message if they click the X by checking beforeunload.
function CancelMessage(){
    //as long as the form is not unloading, confirm cancel with the user
    if (parent.window.event.type != "beforeunload")
    {
        if (window.confirm("Are you sure you want to cancel the action:  "
                       + document.forms("eConfirmCancelForm").Action.value +"?"))
        {
            parent.CancelClick = oldCancel;
            parent.CancelClick();
        }
    }
    else
    {
        alert("You have closed the form without using the red Cancel button below.  Any screen changes have been lost.")
        parent.CancelClick = oldCancel;
        parent.CancelClick();
    }
}


I haven't tried something similar in V9 yet, but I'd think it would be similar/possible.  It doesn't catch/prevent the event, but at least he OK/Cancel doesn't pop up and we tell the users they goofed -- in polite terms ;-)
0
royster

Senior Member
Registered:
Posts: 74
Reply with quote  #3 
Hi BMellett
We used to use a similar piece of code for v7 as well. As I understand it, in v9 the form cancel javascript is supposed run whether the click the canel button or, whether we click the browser close button. It is consistent for the Cancel even, but very inconsistent when clicking browser close. I have now found that, on occasion, the alert will appear and on clicking the Ok or Cancel button, the appropriate action takes place. At other times, the form will close before the alert box appears.
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #4 
Hmm, good to know.  I haven't starting converting that process yet.
To be honest, I always hated that particular function, expecially since it had to be added to every form.  Maybe I can get rid of it.  (Guess I'll find out in a couple months.)
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!