How to popup confirm dialog trying to navigate away with unsaved changes

Is there any generic or built-in solutions for this common requirement?
JDev: 11g
any idea or material on this is appreciated.
Thanks.
Kevin.

try capturing the onBeforeUnload event and display a modal confirmation dialog asking the user if he really wants to navigate away from the page; and warning him that if he does so, all the changes he made hitherto will be gone.
However, you need to handle this intelligently since you need to identify if any fields in the form have changed and only then warn the user to confirm his decision to go away from this page.
You can do this by having a flag which is initialized to false but when onBeforeUnload event is fired, you would check if any of the form fields in the page have changed by iterating over each and every form field,and then setting the flag to true if some thing changed
the onBeforeUnload Handler will always return this flag, if it is true, you will get this confirmation popup, else the page will go away. To show a customized confirmation dialog, perhaps you would have to invoke the custom dialog call from with in the onBeforeUnload handler. When the user says yes, return false;else true.

Similar Messages

  • Confirm Dialog on Closing Web Application with unsaved data?

    Hi all,
    I am searching for best-practices or official solutions for implementing the following functionalty:
    User is trying to close the browser window or tab (Mozilla Firefox) by hitting the "X". We need to ask him if he is sure cause there might be unsaved data.
    The only solution we now see is the following:
    - event "onbeforeunlad":
    window.onbeforeunload = function (oEvent) {
      oEvent.returnValue = 'Sure? Unchanged data might be lost'
    Problem is that this event also runs, when youre navigating in the analysis item, e.g. expanding a hierarchy. You have to switch it of for every single Item with onmouseover and switch it on again later.
    And further on: It still has to be bound to the data... if data hasn't changed, it shouldnt pop up.
    Question: Are there any official suggestions from SAP? Seems to be a standard requirement. If not, do you know any better solutions for implementing this functionality?
    Thanks in advance for your help,
    Michael

    try capturing the onBeforeUnload event and display a modal confirmation dialog asking the user if he really wants to navigate away from the page; and warning him that if he does so, all the changes he made hitherto will be gone.
    However, you need to handle this intelligently since you need to identify if any fields in the form have changed and only then warn the user to confirm his decision to go away from this page.
    You can do this by having a flag which is initialized to false but when onBeforeUnload event is fired, you would check if any of the form fields in the page have changed by iterating over each and every form field,and then setting the flag to true if some thing changed
    the onBeforeUnload Handler will always return this flag, if it is true, you will get this confirmation popup, else the page will go away. To show a customized confirmation dialog, perhaps you would have to invoke the custom dialog call from with in the onBeforeUnload handler. When the user says yes, return false;else true.

  • How can I confirm that my extensions are compatible with FF ver 4 and ver 5 before I upgrade?

    When I have upgraded in the past I have been affected by extensions that do not work in the new version. How can I determine if my extensions are compatible with new versions. I have looked at knowledge base and other help but I can find nothing.

    Thanks, Forewarned is forearmed.
    Checking my incompatible extensions now seems to be less than when I just casually reviewed the list. Perhaps authors are still updating their products.
    Most of my incompatible extensions are not critical. Perhaps the most important is AARDVARK which I use extensive prior to printing bank statements.
    My incompatible extensions are:
    Aardvark
    Colourful Tabs
    Image ToolBar
    MS .NET Framework Assistant
    Quick Page Zoom
    Rewind/Fastforward Buttons
    Windows Update

  • How to disable confirmation dialog when making connection??

    Hi,
    I am trying to use the BT interface on the cell phone to connect with another BT device. However, when the connect.open() fuction is called, a dialog asking for confirmation of the connection will show up. Is there any way I can eliminate the dialog and just establish the BT connection when another device directly when the connect.open() method is called??

    Hi,
    >>however I do not want to see the confirmation message each time data is submitted,  because my loop is paused each time the confirmation message appears, and the only way to resume it, is to click "ok". 
    Sorry, disabling the confirmation message is not possible.  The confirmation is always enabled.
    Thanks,
    Lucia

  • How to disable confirm dialog when deleting messag...

    It is really annoying that each time I delete a message, I have to confirm. How can I disable that on the Lumia 920?
    Also, I spend a long time trying to figure out why my phone did not come with Nokia Music in denmak, after alomost 1 hour searching on the net, I found out that the service do not exist in Denmark... Why not just have the Nokia Music in the App store and just show a message when people try to install it, saying that its not availble in the user's country?

    You can't dsable the confirmation, but you can reduce the number of times you need to confirm to just once by marking the messages you wish to delete first. Shortcut for marking messages is to tap the left hand edge of the message you with to mark.  

  • After 11 years with Verizon, they are trying to get away with ripping me off... Edge program...

    Signed up for Edge in May, somehow VERIZON "accidentally" cancelled my Edge program for 5 months, and then sent me a letter saying they were fixing the problem. I never noticed that it had been cancelled, and have never in 11 years had a problem with Verizon. My bill when on the edge program with the incentives, is about $180 for both phones. When it was not on the Edge program due to Verizon's mistake, my bill was $185 per month for those months. So basically, it was pretty much the same price, because of the incentives we received for adding the Edge program, and we were able to get 2 new phones. After HOURS of speaking on the phone with agents trying to correct this issue when my bill hit over $300 in October, we were finally able to fix the money problem and I wasn't "overcharged". However, there has been no one in this company that has been able to help me fix the other pretty big problem with THEIR error. Since they "fixed" the problem in October, they started my Edge program over, and basically shafted me out of 5 months and payments towards the 2 phones. The only reason we agree to do the edge program was to upgrade phones every 12 months, but now because of VERIZON'S MISTAKE, we are going to have to make 17 payments to reach that halfway point. All they keep telling me is that I wasn't on Edge for those 5 months, so I wasn't paying for the phones, but what noone understands, is that if they never screwed up and canceled my edge on accident, then I would have been paying basically the same amount of money every month, except I would be 5 payments further on my plan. I don't care where they allocated my payments, this was VERIZONS mistake and they need to go back those 6 months and fix every bill to show that I was on the edge program and they need to update my account, but refuse to help me. WHO SHOULD I CONTACT FOR HELP? News companies, better business bureau?? I'm so frustrated.

    This happened to me to and I feel strongly that Verizon should correct the extension of the end date on 2 phones on my account. I upgraded 3 lines on my account on the same day in April 2014 - one line has continued on the Edge program correctly, 2 lines were taken off the Edge program in error by Verizon and when Verizon discovered their error (and of course caused billing issues that were difficult to work through) and put the 2 phones back on the Edge program, those 2 phones now have a much later end date than the one line that didn't get canceled off Edge (again error  by Verizon). During my last conversation with a Verizon rep while correcting the billing issue, I asked if they could correct the issue on the completion/upgrade timeline on the 2 lines Verizon messed up & was told it was a different department I would need to talk to....I am working up the time & patience to spend on a call to Verizon to see if there is anyway they will fix this as they should!

  • Trying to save image with opacity changed, but no transparency is save with png

    I'm saving it as png24, the transparency box is checked. Here are the steps I'm following:
    1. In layers window, right click on layer and select blending options.
    2. Add outer glow effect and just take the defaults.
    3. Back in layers window, I open the layer effects dropdown and select linear dodge (add)
    4. Slide the opacity level down to 85%. Image now looks as I want it.
    5. Save for web, transparencey box is checked, saving as png24, image looks correct in the save window.
    6. Save the file.
    Now when I open the file in Preview(Mac), or download it to the android app I'm writing, image shows up with no transparency, opacity is at 100%.
    What I am doing wrong?
    Thanks for any help.....

    Preview just shows transparency with a gray background. And I'm not sure how your android app would show it.

  • Viewers may think your photos are out of focus and navigate away with a "pshaw!"

    Suggestion for Adobe re: our online albums that people can access (such as http://bclayshannon.photosho.com):
    When images are loading, use an hourglass or even some text to let the user know the fuzzy picture they are at first seeing is not the "final" image: just "hold your horses/keep your pants on" and the image in all its glory will soon display - something to that effect (at least an hourglass).

    Hi, Clay. Photoshop.com has its own forum, so you might want to post this there:
    http://forums.adobe.com/community/photoshopdotcom

  • Submiting JSF form on clicking ok of Confirm dialog box

    Hi,
    We are using JSF 1.2 and Seam 2 in our project.
    We have set of requirements
    1)To throw a confirmation dialog box when user tries to navigate away from page with out saving the data changes. It includes browser closure, back button and refresh as well along with other application navigation links.
    2) upon clicking ok we need to save the current JSF form and redirect to where user is intended to navigate.
    Please let me know the best ways of implementing the above requirements.

    For the first point, I totally agree with Raymond and you can use the javascript function like this:
    <script>
    window.onbeforeunload =
    function(){
    if((window.event.clientX<0) || (window.event.clientY<0)){
    //create new confirm window here
    //I guess you can check on opening a new JSF page itself as a pop up.
    //in that page with normal form and submit buttons, I guess you can call JSF action methods.
    </script>

  • Confirmation Dialog which saving any settings at OCI Mapping

    Hi Experts,
    OCI Mapping:
    when i change and settings at OCI and when i click on Save button, I used to get popup(Confirmation Dialog) window with messaage as " Price fields are not configured consistently across all views".
    I am not able to findout what is exact problem and why it is showing such message?
    You help will be rewarded in points..
    Thanks
    Bharat

    that happens when the same price setting fields (contract and list price) are not set for all the views in the catalog .
    you should have the same fields (settings) for price - in all the views in the catalog (Resultset , Itemdetials, context, compare and Shopping list) to ignore the warning
    thanks
    -Adrivit

  • How to update views with new changes

    Hi Experts
      I had 3 views created on a Query,Which(views) are being used in Dashboard reports.
      Now as per my requirment i need to update my Query with few new chars and some user enty variables.
      How can i update my views....with new changes
    Thanks

    Hi developerbw,
    Here are steps you can do to make the change
    1. open your old view
    2. make the change
    3. save the view uing the same description and technical name, (Make sure you you say yes when it ask whether to overwrite the exisitng view)
    no need to create new views
    feng

  • How to Stop confirmation popup arising for datepicker control in IE

    Hello All,
    I m using a confirmation popup to notify user when they try to navigate away from the page with out saving the changes made. I executed it through the javascript and it even works properly for most of the items and buttons except Datepicker control. This issue is only with Internet Explorer and all others are fine.
    I use the following block of code to do the job
    +function isFormChanged()
    {+
    var rtnVal = false;
    var frm = document.wwv_flow;
    var ele = frm.elements;
    for ( i=0; i < ele.length; i+ )
    {+  
    +if ( isElementChanged( ele, i ) )
    {+
    rtnVal = true;
    break;
    +}+
    +}+
    return rtnVal;
    +}+
    +function isElementChanged( ele, i )
    {+
    var isEleChanged = false;
    +switch ( ele.type ) {+
    case "text" :
    +if ( ele[i].value != ele[i].defaultValue ) return true;+
    +if( ele[i].id.indexOf('Date')!=-1) return false;+
    break;
    case "textarea" :
    +if ( ele[i].value != ele[i].defaultValue ) return true;+
    break;
    case "radio" :
    val = "";
    +if ( ele[i].checked != ele[i].defaultChecked ) return true;+
    break;
    case "select-one" :
    +if      (ele[i].id>99 ) return false;+
    +for ( var x =0 ; x <ele[i].length; x++ )
    {+
    +if ( ele[i].options[ x ].selected+
    +!= ele[i].options[ x ].defaultSelected ) return true;+
    +}+
    break;
    case "select-multiple" :
    +if      (ele[i].id>99 ) return false;+
    +for ( var x =0 ; x <ele[i].length; x++ )
    {+
    +if ( ele[i].options[ x ].selected !=+
    +ele[i].options[ x ].defaultSelected ) return true;+
    +}+
    break;
    case "checkbox" :
    +if ( ele[i].checked != ele[i].defaultChecked ) return true;+
    default:
    return false;
    break;
    +}+
    +}+
    var g_saving = false;
    var IsThe2ndNavAway = false;
    var g_errmsg="The changes you made to the page were not saved.";
    +function WarnSave()
    {+
    var formChanged = isFormChanged();
    if (!g_saving && formChanged)
    +{+
    if(!IsThe2ndNavAway)
    +{+
    IsThe2ndNavAway=true;
    +var tOut = window.setTimeout(function () { IsThe2ndNavAway = false; }, 0);+
    return g_errmsg;
    +}+
    +}+
    +}+
    function doSave()
    +{+
    g_saving=true;
    doSubmit('SAVE');
    +}+
    the above lines on page Html header and the Html body attribute with onBeforeUnload="return WarnSave();"
    Can any one say why the confirmation popup is pushed of in IE for DatePicker Calendar alone and provide the work around if any..

    Are you still having this problem?  See this post how one AOL user solved it: http://forums.adobe.com/message/3024814#3024814

  • How to get  the choice clicked by the user on a Confirmation dialog?

    Hi,
    'm trying with Confirmation dialog which should return
    'yes', 'No', or 'Cancel'
    I wrote like:
    String Message="Do u want  to update ??";
         IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
         IWDConfirmationDialog dialog =wdComponentAPI.getWindowManager().createConfirmationWindow( Message, controllerInfo.findInEventHandlers("Yes"), "Yes");
         dialog.addChoice(controllerInfo.findInEventHandlers("No"),"No");
         dialog.addChoice(controllerInfo.findInEventHandlers("Cancel"),"Cancel");
         dialog.open();
    It works as a normal dialog window
    But how can I get the choice that is clicked by the user.
    ie . either 'Yes', 'No', or 'Cancel'.
    can any body help me
    thanks
    Smitha

    Smitha,
    In addition to your code, create 3 event handlers in your controller, name them Yes, No, Cancel. In every event handler you know what event was fired, i.e. what button is pressed.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • How do I stop the "Confirm Dialog Preference" box from appearing everytime I load a page?!

    Every time I a go to a new page, whether it is the same site or not, I get a dialog box that appears that reads "Confirm Dialog Preference," and the options include yes or no. How do I get this to stop? It is really, really annoying.

    Can you attach a screenshot showing the dialog?
    Does the issue still occur if you start Firefox in Safe Mode? http://support.mozilla.com/en-US/kb/Safe+Mode
    How about with a new, empty profile? http://support.mozilla.com/en-US/kb/Basic%20Troubleshooting#w_8-make-a-new-profile

  • How to popup dialog?

    Hi,
    I made a synchronous task with dialog asking W.Flow creator to select the agent.
    When I run workflow this dialog does not popup. Instead it goes to my Business Workplace.
    Question:  how to make this dialog to popup immediately after work flow has been triggered?
    Thank you.

    Hello,
    If your workflows triggered using an event, this is an asynchronous process regardless of your task setting. This is because events are published using RFC, therefore the connection to the user dialog is lost.
    Your alternatives are:
    Don't use workflow for the agent selection, but to do the pop-up in a user exit and pass the agent selection to workflow at using an event parameter.
    Don't use an event to trigger workflow, but start it directly using a WAPI function module.
    Cheers,
    Mike

Maybe you are looking for

  • How do I move where a drop-down hotspot's content displays?

    I would like to know if there is an easy way to move where a drop-down hotspot's content displays. Here's an example: [+] 1)  Do this, and make sure you include: this one that one those things I'm using the [+] as my hotspot before the step like I sh

  • Best possible way to achieve HashMap (Java Collection) in ABAP

    Hi I need to store name-value pair at runtime, where name act as a key (something what HashMap provides in Java). What is the best possible approach to do this? I can create a Structure (having two fields name and value) and then a Table Type on this

  • Mail and OS: how they works with dns

    Hi to all. I need an help to understand. I have a domain, "pippo.it"; this domain has an MX set in this way: pippo.it MX mail.pippo.it mail.pippo.it A 151.99.0.100 ; Wan 1 mail.pippo.it A 91.45.98.76 ; Wan 2 With this setting I'm sure that if one lin

  • Massive memory leak when using Google (normal search, inactive, but logged into Google+)

    Firefox has massive memory usage in recent times (runs up to over 3GB on Win7x64HP). I was not sure until now what caused it, since I have the browser open in the background most of the time. Commonly open pages are facebook, some news site (containi

  • Controlling water level of spherical tank using labview.

    Hi, I'm trying to control the water level of a spherical tank model using PID in labview. The model is a non-linear equation as follows: Qi(t-L)-Qo=pi*R^2(1-(R-y)^2/R^2)dy/dt where Qi=inlet flow Qo=Outlet flow R=tank radius y=height of water t=time I