This discussion is archived
1 Reply Latest reply: Sep 29, 2011 9:18 AM by ArtashesGamarian RSS

Prompt to save markups when existing AutoVue

886915 Newbie
Currently Being Moderated
Hi,

I am trying to add "Prompt to save markups" when exiting AutoVue by closing a Web Browser window.
I am having trouble with "Cancel" button as its not behaving as expected.

When I close the browser window with modified markups I get a prompt with three options :

a) Yes -- Allows to save and exit . Behaves as expected . All good.
b) No -- Ignore changes and exits . As expected . All good.
c) Cancel -- Ignore changes and exits. Behaves exactly as "No" option. I expected it to return to applet and DO NOTHING . Instead it closes the window.

Below is the code I am using to activate this feature .
function onClose()
{
    window.document.applets["JVue"].saveModifiedMarkups();

    window.document.applets["JVue"].waitForLastMethod();
}

<body onLoad="onBodyLoad()" onBeforeUnload="onClose()">
Am I doing something wrong or Is that the expected behaviour of "Cancel" or Is it a bug ?

Regards,
Rizwan.

Edited by: MarkAconex on Sep 21, 2011 11:29 PM
  • 1. Re: Prompt to save markups when existing AutoVue
    ArtashesGamarian Explorer
    Currently Being Moderated
    Hi Rizwan & Mark,

    Sorry for a late reply, trouble with notifications...

    The problem here is that the script is called from the web page just before closing it and applet doesn't have an option to stop page from closing anyway, that's why 'cancel' option is not correct in this context.

    saveModifiedMarkups() method has 2 variations, you need to call the one that takes 'mayCancel' parameter and set it to false.
    In that case the prompt will only have two options: 'yes' and 'no'.
    So your function will look like this:
    function onClose()
    {
    window.document.applets["JVue"].saveModifiedMarkups(false);

    window.document.applets["JVue"].waitForLastMethod();
    }

    Please let me know if you have any farther questions related to this...

    Thanks,
    Artash.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points