Prompting user to save changes before leaving jsp

Folks,
I want to be able to prompt the user to save changes on the page that he's on, before he navigates to a different one. one idea i explored is using the body onUnload event. the problem is that my page is split into multiple jsps with tiles, and the body tag is in a common tile that i can't really access.
Any other ideas on how to do this?
Thanks,
Nilesh

nthali wrote:
well, onbeforeunload seems to be an IE specific event. we have some customers using firefox etc.It works in at least IE 5.0, FF 1.5 and Safari 1.3. Only not in Opera yet, because it very strictly follows the w3 standards. It doesn't support the onunload either though, which was also invented by Microsoft and adopted by FF and Safari, only a bit earlier than the onbeforeunload.
And as I already said, the onunload is already too late. The browser will (already) be closed regardless of the (outcome of the) warning message.

Similar Messages

  • Prompt user to save change before abnormally closing the application

    Hi,
    I've some trouble prompting user to save change before abnormally closing the application (logging off, shutdownding machine...). I tried to use Runtime.getRuntime().addShutdownHook() and it doesn't seem to work. Here's part of my code. Help please!!!
    program print out "1" and stays in a "dead-lock" mode...
    private void shutdown() {
    boolean saveConfig = true;
    if (saveConfig) {
    System.out.println("1 ");
    int answer = JOptionPane.showConfirmDialog(null,
    "Configuration has been changed. Do you want to save
    configuration before exit?",
    "Save Config"
    JOptionPane.
    YES_NO_CANCEL_OPTION);
    JOptionPane.showMessageDialog(this, "Can't connect to unit. Error in Heal unit!", "Error", JOptionPane.INFORMATION_MESSAGE);
    System.out.println("2 ");
    if (answer == 0) {
    savefileButton_actionPerformed();
    jMenuFileExit_actionPerformed();
    else if (answer == 1) {
    jMenuFileExit_actionPerformed();
    else {
    return;
    else {
    int answer = JOptionPane.showConfirmDialog(itself,
    "Are you sure you want to exit? ",
    "Exit",
    JOptionPane.YES_NO_OPTION);
    if (answer == 0) {
    jMenuFileExit_actionPerformed();
    else {
    return;
    private class MyShutdownHook extends Thread {
    public void run() {
    shutdown();
    // add shutdown hook
    MyShutdownHook shutdownHook = new MyShutdownHook();
    Runtime.getRuntime().addShutdownHook(shutdownHook);

    doesn't much matter. shutdown hooks are not guaranteed to run or be able to finish.

  • ARD 3 not prompting user to save changes on restart

    Hello! I have ARD 3 and when I send out a restart command and select the radio option "Users can save changes or cancel restart" it acts as if I didn't select this, and instead selected "Users lose unsaved changes".
    This has never worked for me. If working properly, it SHOULD actually show up on the affected computer a dialog popup of some sort providing the user just those option: to save changes or cancel restart.
    What is wrong/going on, and how do I fix it?
    Thanks ahead of time,
    Sam M.

    nthali wrote:
    well, onbeforeunload seems to be an IE specific event. we have some customers using firefox etc.It works in at least IE 5.0, FF 1.5 and Safari 1.3. Only not in Opera yet, because it very strictly follows the w3 standards. It doesn't support the onunload either though, which was also invented by Microsoft and adopted by FF and Safari, only a bit earlier than the onbeforeunload.
    And as I already said, the onunload is already too late. The browser will (already) be closed regardless of the (outcome of the) warning message.

  • ARD 3 not prompting user to save changes even when told to

    Hello! I have ARD 3 and when I send out a restart command and select the radio option "Users can save changes or cancel restart" it acts as if I didn't select this, and instead selected "Users lose unsaved changes".
    This has never worked for me. If working properly, it SHOULD actually show up on the affected computer a dialog popup of some sort providing the user just those option: to save changes or cancel restart.
    What is wrong/going on, and how do I fix it?
    Thanks ahead of time,
    Sam Marcus

    Slava Natapov wrote:
    Samita wrote:
    Whenever a user changes some items in Block_1 and presses save button, the values from non_db items get copied to the db_items (based on view) and commit_form is called. Try to copy values to the db_items not in save button, but in WHEN-VALIDATE_ITEM of non_db items.- I created the non-db items becoz, it was asking me 'Do you want to save changes', even when I only queried data from the view (becoz i was doing some computations while displaying the items. and the form assumed that the DB items were begin changed ). Inorder to get rid of that problem, i used mirror_items (non-db) for all the db items.
    So under this scenario, when i copy values to the db_items in WHEN-VALIDATE_ITEM trigger of non_db items, the form considers the db_items are changed and asks 'Do you want to save changes' even when the user has not made any changes and only queried data.
    Edited by: Samita on Dec 9, 2009 10:12 AM

  • How to prompt users to save changes?

    Hi,
    I am using WAD to develop planning layouts for BIIP.
    I am curious as how to prompt the user to save the changes thay made to the data on the layout if they decide to navigate away from the page.
    Any suggestions?
    thank you

    Hi AG
    Did you find the place choosing the options? I didn't remenber them all, you can try to search these options.If you want to change the default value of this option, you can go to System Administration --> System Configuration --> Service Configuration --> Applications --> com.sap.portal.epcf.loader --> services --> epcfloader. Set the value of Workprotect.mode.default, which default is 1, and other three options are related to 2, 3, 4.
    Best regards.

  • How to prompt users to save changes to layouts

    Hi,
    I am using WAD to develop planning layouts for BIIP.
    I am curious as how to prompt the user to save the changes thay made to the data on the layout if they decide to navigate away from the page.
    Any suggestions?
    thank you
    Message was edited by:
            AG

    They can use Acrobat to save the form.
    If they only have Adobe Reader, they need to Reader extend the form, to enable Adobe Reader to save the form with data.
    Jasmin

  • I have forgotten my security question answers, i have tried to reset them but it keeps saying i need to save changes before i leave the page, i try to but it does nothing. help?

    i have forgotten my security question answers, i have tried to reset them but it keeps saying i need to save changes before i leave the page, i try to but it does nothing. help?

    Reset Security Questions
    Frequently asked questions about Apple ID
    Manage My Apple ID
    Or you can email iTunes Support at iTunes Store Support.
    If all else fails:
    Go to: Apple Express Lane;
    Under Product Categories choose iTunes;
    Then choose iTunes Store;
    Then choose Account Management;
    Press Continue;
    Now choose iTunes Store Security and answer the bullet questions, then click Continue;
    Sign in with your Apple ID and press Continue;
    Under Contact Options fill out the information and advise iTunes that you would like your security/challenge questions reset;
    Click Send.
    You should get a response within 24 hours by email.
    Presently there appears to be problems on Apple's end, so it may be quite some time before they respond.
    Another user had success doing the following:
    I got some help from an apple assistant on the phone. It is kind of round about way to get in.
    Here is what he said to do and it is working for me...
    on the device that is asking you for the security questions go to "settings", > "store" > tap the Apple ID and choose view"Apple ID" and sign in.
    Tap on payment information and add a credit/debit card of your preference then select "done", in the upper right corner
    sign out and back into iTunes on the device by going to "settings"> "store" > tap the Apple ID and choose "sign-out" > Tap "sign -in" > "use existing Apple ID" and you should be asked to verify your security code for the credit /debit card and NOT the security questions.
    At this time you can remove the card by going back in to edit the payment info and selecting "none" as the card type then saving the changes by selecting "done". You should now be able to use your iTunes store credit without answering the security questions.
    It's working for me ...I just have to put in my 3 digit security pin from the credit card I am using.
    Good Luck friends!

  • Adobe Reader X prompting me to save changes every time I close a document! Please help

    I open the PDFs and when I close it, it asks me "Do you want to save changes before closing", when there are no changes made!
    This is such an inconvenience, please help to solve the issue. I tried to go to Edit -> Preferences -> Documents -> and unchecked Save settings options, but it didnt work

    Thanks Pat. It so happens that I myself am the author of these PDFs. Is there something I need to change (settings etc) and rebuild these files, so the issue doesnt recur? BTW, I am using Adobe FrameMaker 11 to create the docs.
    If there is a link which addresses this issue, please point me to that.
    Thanks in advance....

  • Prompted to save changes before closing when there's been no changes

    When opening some PDFs I am prompted with thie dialog box "Do you want to save changes to .........before closing?".
    This is not displayed for all PDFs I open, just some.
    Does anyone know if there is a way I can stop this message being displayed?
    We have version Acrobat Reader 10.1.3 running on XP SP3.
    Thanks for your help.

    I don't see the "being repaired" message, but it likely just disappears before I can see it.  Given that, Adobe Reader's behavior makes sense - the document has been repaired, so it has been changed.
    The bad files I had were downloaded a while ago from ProQuest and produced by "image2pdf.c".  It looks like they were aware of the problem, because if I download the same document now, it looks the same, but the PDF file is a different size and the problem does not occur.
    Thanks for your help.

  • I have been working and the word program does not respond how do i save changes before forcing

    I have been working a word document and now the program does not respond, can I save the changes before forcing to close the application?

    no

  • Allowing a user to save changes

    I am creating an app that is something similar to this one:-
    http://demo.quietlyscheming.com/DragTile/DragDrop.html
    However what I want is when a user drags an item from one tilelist into the other tilelist for them to be able to save these changes so that when they close the application and reopen it these changes will still be there i.e. if the top tilelist is tilelist1 and the bottom tilelist is tilelist2 and the user drags a couple of items to tilelist1 TO tilelist2 I want these items to appear in tilelist 2 after the app has been closed and reopened and the items that have been moved NOT to appear in tilelist 1 anymore.
    I also want the user to be able to type their name into a text area and save it by clicking a save button so their name will also be shown next time they open the app.
    What is the best way to do this? Via xml perhaps? I've used xml to contain data that populates a site in the past but never used it where it allows user's to actually insert data into an xml file. Are there any examples of anything simiar that may help me out?

    That may work but I'm not sure on how to apply it to my own application. Here's a little bit of my code to show you what I mean. The button marked "populate" populates the left hand tilelist when clicked and also acts as a reset button if the user wants to reset the links back to normal. What I want is when the button marked "save" is clicked for all the changes a user has made to both tilelists to be saved. How can the following code be edited to allow that:-
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.collections.*; 
    private function profile1NewsAndSportReset():void {profile1NewsAndSportAddLinksTilelist.dataProvider =
    new ArrayCollection([{link:
    "www.bbcnews.com", label:"BBC News", icon:"image7", largeImage:"assets/images/bbcnews_small.png", title:"BBC News", description:"BBC News description will go here"},{link:
    "www.itv.com/", label:"ITV", icon:"image5", largeImage:"assets/images/itv_small.png", title:"ITV", description:"ITV Description will go here"},{link:
    "www.skynews.com", label:"Sky News", icon:"image10", largeImage:"assets/images/skynews_small.png", title:"Sky News", description:"Sky News Description will go here"},]);
    profile1NewsAndSportLinkChoice.dataProvider =
    new ArrayCollection([]);}
    ]]>
    </mx:Script>
    <mx:Button click="profile1NewsAndSportReset()" id="pop" label="populate tilelists" y="0"/>
    <mx:TileList id="profile1NewsAndSportLinkChoice" fontWeight="bold" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" height="292" width="650" top="0" left="521" columnCount="5" rowHeight="145" columnWidth="125" doubleClickEnabled="true" backgroundColor="#000000" borderColor="#FFFFFF" color="#FFFFFF" borderSides="top right left"/> 
    <mx:TileList id="profile1NewsAndSportAddLinksTilelist" fontWeight="bold" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" height="419" width="385" top="0" left="128" columnCount="3" rowHeight="145" columnWidth="125" doubleClickEnabled="true" backgroundColor="#000000" borderColor="#FFFFFF" color="#FFFFFF" borderStyle="solid" borderThickness="2" dropShadowEnabled="true"/>
    <mx:Button click="" id="save" label="Save Changes" x="0" y="30"/>
     </mx:WindowedApplication>

  • How to promt user to save changes when changing non-database fields?

    Hi,
    I have a form with two tabs. The datablock Block_1 on tab_2 is based on a database view. But all the displayed items of Block_1 are non-database items. Whenever a user changes some items in Block_1 and presses save button, the values from non_db items get copied to the db_items (based on view) and commit_form is called. This works fine.
    But the problem here is: after changing some items in block_1, if the user navigates to some other option/form from the menu , the form doesnt promt the user to 'save the changes' and all the changes made are lost. How can I fix that?
    I have a form level key-exit trigger, (which does not fire) with following code :-
    Declare
      X  Number;
      alert_is             alert;
    Begin
    If :System.Mode = 'ENTER-QUERY' Then
           Exit_Form;
    Else
      If :System.Form_Status In ('NEW','QUERY') Then
           alert_is := FIND_ALERT('TMPL_EXIT'); -- "Are you sure you want to exit?"
        X := Show_Alert('TMPL_EXIT');
        If X = Alert_Button1 Then
           Exit_Form(no_validate);
        End If;
        Else
           Exit_Form;
      End If;
    End If;
    End;

    Slava Natapov wrote:
    Samita wrote:
    Whenever a user changes some items in Block_1 and presses save button, the values from non_db items get copied to the db_items (based on view) and commit_form is called. Try to copy values to the db_items not in save button, but in WHEN-VALIDATE_ITEM of non_db items.- I created the non-db items becoz, it was asking me 'Do you want to save changes', even when I only queried data from the view (becoz i was doing some computations while displaying the items. and the form assumed that the DB items were begin changed ). Inorder to get rid of that problem, i used mirror_items (non-db) for all the db items.
    So under this scenario, when i copy values to the db_items in WHEN-VALIDATE_ITEM trigger of non_db items, the form considers the db_items are changed and asks 'Do you want to save changes' even when the user has not made any changes and only queried data.
    Edited by: Samita on Dec 9, 2009 10:12 AM

  • Prompting users to save

    Is there a way to implement an iView that can detect when a user has entered data into controls, and then navigates to another page without having saved the data by clicking the save button?  Requirement is to stop the page navigation and prompt the user to save.  I'm curious to know if any of the Java, BSP/ABAP, or .NET development tools could help in this regard.  Any help would be greatly appreciated.

    Hi Brian,
    this is (should be, didn't install it yet) a feature from EP6 SP3 on. You have to use the EPCF (within this, the so called work protect feature) to set the dirty-flag; with SP2, when the dirty flag has been set and the user wants to navigate, another window opened (so that the not saved data won't get lost). SAP had implemented your disired behaviour for it's own special cases, but from SP3 on, this should be a standard feature; also see https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/enterprise portal client.pdf and http://help.sap.com/saphelp_nw04/helpdata/en/37/50fb5066f9db43b3b5d5fc8de0c051/content.htm.
    Hope it helps
    Detlev

  • Possible to have alert message for unsaved changes before leaving a page ?

    Hi Experts,
    just wonder if the subject matter is handled by APEX now or need some further technique to do so.
    Thanks.

    There is no standard solution for that. See this thread:
    Re: Autocommit or showing the message before leaving the page
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • JavaScript to prompt user to save as PDF

    I am making changes with code to the file. I want the user to be prompted to save as a .ai file first. I have that down. Now I am wanting to have the user immediately be prompted to save as a pdf with only the optimize for fast web view option selected. I believe it is an adobe preset of Smallest File Size.
    The reason for wanting the prompt is because I want to save the files in 2 different locations.
    Here is my code so far.....
    var doc = app.activeDocument;
    // Save as .ai file 
    var fileName = doc.fullName; 
    var thisFile = new File(fileName);
    var saveFile = thisFile.saveDlg();
    doc.saveAs (saveFile);
    // Save as .pdf file
    var pdfSaveOptions = new PDFSaveOptions(); 
    pdfSaveOptions.pDFXStandard=PDFXStandard.PDFXNONE; 
    pdfSaveOptions.compatibility = PDFCompatibility.ACROBAT5; 
    pdfSaveOptions.preserveEditability = false; 
    var pdfFile = new File(fileName); 
    doc.saveAs(pdfFile, pdfSaveOptions);
    AI CS4 Windows 7 64bit

    is the folder structure existing already?
    if so, things are simple.
    if the job number and name are in the file the you could pull that from the doc rather then manual entry at the prompts.
    (please note this has no testing to check folders exist etc...)
    var job = prompt("Enter Job Name");
    var num = prompt("Enter Job Number");
    aiFile = "D:\\"+job+"\\"+num+"\\AI\\Schematic.ai"
    pdfFile = "D:\\"+job+"\\"+num+"\\PDF\\Schematic.pdf"
    var newaiFile = new File(aiFile);
    var doc = app.activeDocument;
    doc.saveAs (newaiFile);
    var pdfOpts = new PDFSaveOptions();   
    pdfOpts.pDFXStandard=PDFXStandard.PDFXNONE;
    pdfOpts.compatibility = PDFCompatibility.ACROBAT5;   
    pdfOpts.preserveEditability = false;
    var newpdfFile = new File(pdfFile);   
    doc.saveAs(newpdfFile, pdfOpts);
    if you want the script to create the folders then its a little harder.
    Javascript will not do this and you need some other work around.
    something like this...
    if (Folder(qfolder).exists){
    app.activeDocument.saveAs( saveName, saveOpts );
    }else{
               //alert("about to try bat");
               batpath= 'call "C:\\Adobe Scripts\\MakeDirectory.bat"';
                battemp = new File("C:\\Adobe Scripts\\tempBAT.bat");
                battemp.open("w");
                battemp.writeln(batpath + " " + qfolder);
                battemp.close();
                battemp.execute();
             //alert("Had to Create Folder, Please press OK to continue...");
                $.setTimeout = function(func, time) {
                        $.sleep(time);
                        func();
             $.setTimeout(function(){ app.activeDocument.saveAs( saveName, saveOpts )},200);
    the MakeDirectory.bat is just:
    ECHO OFF
    CLS
    IF %1=="" GOTO BLANK
    SET savepath=%*
    MKDIR %savepath%
    GOTO FINISH
    :Blank
    ECHO No Folder provided
    GOTO FINISH
    :FINISH
    the tempBat.bat is used to call the MakeDirectory.bat with the folder name as an argument.

Maybe you are looking for

  • Can't open .tpl or edit MMDocumentTypes.xml to allow the .tpl extension

    I've been searching for a while on how I can open a .tpl file on Dreamweaver MX. The one thing I keep finding is to open up MMDocumentTypes.xml and include tpl in the first line after winfileextension. However, when I go to save after I have done thi

  • How to customize the applet's status bar in Oracle Forms 9i

    I extended the statusBar class to include our own message in the applet's status bar. Using JDeveloper I compiled the class and jared the class file. Eventhough I placed that jar file in the classpath, it is not shown in the "import java classes" dia

  • Oracle applications in reg to reports

    Hi The Issues it was like this when Concurrent Request Successfull Completed Without any errors But output File is not Generated in Oracle Apps 11.5.9 Environment. When we checked in log file it showing Error Like this FRM-41839:Disk I/I error on Tem

  • Need a create db script to manually create a 10g rman catalog db on unix

    Hi, Gurus: I would like to manually create a rman catalog database (Oracle 10g) on a HP-UX environment. Could anyone share a sql script to do that? It is going to be used to backup about 15 databases directly to tape and the retention policy is going

  • Getting my partners MacBook onto our wireless home LAN using WPNT834

    I don't have much experience with Macs but know a bit about basic networking, well enough to set up a home network based on a cable modem, cable router with both wired and wireless PC clients. My partner has a MacBook which used to be on the wireless