Cancel button to display confirmation dialog in an edittable form

Hi everyone.
I have got a requirement that in my edittable form, I need to show confirmation popup before canelling the page and discarding all the changes.
But, before showing that dialog, I need to figure out if any changes happened or not?
As usual, my cancel button is set to immediate=true, and for that reason, I couldn't find any way to see whether user done any change or not.
As far as I know, there are two ways to find out the changes:
1. using Data control
        ApplicationModule am = ADFUtils.getDCBindingContainer().getDataControl().getApplicationModule();
        return am.getTransaction().isDirty();
     OR
        BindingContext bc = BindingContext.getCurrent();
        String currentDataControlFrame = bc.getCurrentDataControlFrame();
        return bc.findDataControlFrame(currentDataControlFrame).isTransactionDirty();
2. using commit button:
Boolean changed = (Boolean)JSFUtils.getManagedBeanValue("bindings.Commit.enabled");
But, both of them cannot reflect the change in case of postback caused by cancel button, as mentioned its immediate=true
Any solution to find out changes if cancel  button pressed?
Cheers,
Nasser

I have the same case, and I'm using the below code for the button action listener, with immediate=true.
    ControllerContext cctx = ControllerContext.getInstance();
        if (cctx.getCurrentRootViewPort().isDataDirty()) {
            RichPopup.PopupHints hints = new RichPopup.PopupHints();
            getExitPopup().show(hints);
try this, maybe it will help.

Similar Messages

  • Display confirmation dialog when opening PDF

    I've been asked to add a confirmation dialog box to a PDF file that includes a legal disclaimer. The dialogue box would display when opening the pdf document and include yes and no buttons to confirm that the user understands and accepts the disclaimer before reading the document. Selecting "Yes" would allow them to proceed, while selecting "No" would close the file. Is it possible to create something like this in Acrobat? I'm running Acrobat Standard 8.
    Thanks,
    Eric

    Hi Eric,
    Yes, you can do that but it's not an easy task.  You need to code the dialog in JavaScript and then use OCGs (layers) for a cover sheet that will remain "on" until the user selects the Yes button in the dialog.  Coding the dialog is a major task to do by hand and I'm not sure if Acrobat 8 Standard has the OCG capability.
    Check out our tool AcroDialogs(http://www.windjack.com/products/acrodialogs.html) for making dialog creation about 100 times faster and easier, and there is an example of a license dialog agreement just like what you are asking for on that page- scroll down to the Document License Dialog Example. But again, that solution was developed with Acrobat Professional and I'm not sure if Standard handles OCGs or not- you'll have to check on that.
    Also keep in mind this is by no means a foolproof security methodology.  However, it does provide a way to ensure the user agreed to the dialog before viewing the rest of the content.
    Hope this helps,
    Dimitri
    WindJack Solutions
    www.windjack.com
    www.pdfscripting.com

  • How to stop the Flex application when user clicks on Cancel button from JS-confirm message?

    Hi All,
    I use the next code when a user clicks on a link:
    private function clickHandler():void
          ExternalInterface.call('confirm', 'Of course you want to go to the Adobe forums!');
          navigateToURL(new URLRequest('http://forums.adobe.com'), '_self');
    This will show up the javascript confimation box. But when the cancel-button is clicked, the user goes straightly to http://forums.adobe.com...
    How to stop Flex performing the next code when a user clicks on the Cancel button?
    Or, how to catch which button is clicked by a user in Flex?
    Thanks!

    I agree with Mr. Hall that using mx.controls.Alert in Flex may be a better route.
    Show the Alert like this:
    // show an alert with a question and yes and no choices
    Alert.show( "Would you like to go to the Adobe Forums?", "Question",
         Alert.YES | Alert.NO, this, closeHandler, null, Alert.YES );
    Then handle the response in the closeHandler() function:
    protected function closeHandler( closeEvent:CloseEvent ):void
    if( event.detail == Alert.YES )
         navigateToURL( new URLRequest('http://forums.adobe.com'), '_self' );
    else if( event.detail == Alert.NO )
         // they chose no
    The following documentation on Alerts may be helpful:
    http://www.flexafterdark.com/docs/ActionScript-Alert
    Let me know if that helps...
    Ben Edwards

  • DW CS3 does not display confirmation dialog when checking out file

    We have 3 developers set up with DW CS3 Version 9 build 3481.
    When checking out a file that is already checked out one pc will
    display a dialog box to confirm that you want to check-out the file
    as it is already checked out by someone else. This is good as we
    want this dialog to appear. However on the other 2 pc's there is no
    dialog box displayed and the checkout process continues as if the
    file was never checked out.
    The text of the confirmation dialog box reads as such :
    "index.cfm is checked out by first.lastname. Are you sure you want
    to override his/her checkout?". I have been through the preferences
    and verified that we have setup the sites in the same manner but we
    still have this issue.
    Is there a known bug regarding this feature? Is there a
    preference setting somewhere that I have missed?
    thanks

    Are each of your developers sharing the same local site?
    That's why you are
    getting this error if they are. The proper setup would
    involve THREE
    locations:
    1. Local sites (unique to each workstation)
    2. Staging server (shared by all workstations)
    3. Production server (the live site)
    You would have TWO site definitions, which would be -
    (for each workstation)
    1. Local = #1 (unique location for each workstation)
    2. Remote = #2
    (for one MASTER workstation)
    1. Local = #2
    2. Remote = #3
    Use the first site definition for day-to-day work and
    checking files in/out.
    Use the second site definition ONLY for pushing files from
    the staging
    server to the production server.
    That's the only way it will work....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "bemor" <[email protected]> wrote in message
    news:g3ojq5$4il$[email protected]..
    > We have 3 developers set up with DW CS3 Version 9 build
    3481. When
    > checking
    > out a file that is already checked out one pc will
    display a dialog box to
    > confirm that you want to check-out the file as it is
    already checked out
    > by
    > someone else. This is good as we want this dialog to
    appear. However on
    > the
    > other 2 pc's there is no dialog box displayed and the
    checkout process
    > continues as if the file was never checked out.
    >
    > The text of the confirmation dialog box reads as such :
    "index.cfm is
    > checked
    > out by first.lastname. Are you sure you want to override
    his/her
    > checkout?". I
    > have been through the preferences and verified that we
    have setup the
    > sites in
    > the same manner but we still have this issue.
    >
    > Is there a known bug regarding this feature? Is there a
    preference
    > setting
    > somewhere that I have missed?
    >
    > thanks
    >

  • In File Dialog, when click Cancel button, it prompts error and VI exits

    Does anyone can give me an idea on how to solve this problem? When the user click on the Cancel button in the File Dialog box, it prompts out error and says "Operation canceled by user". How can I handle this error?
    I got the same error when I click on the Cancel button when the system prompts me for replacing an existing file. Btw, how can I stop the system from prompting me to replace an existing file? Thankssss.....

    Hi,
    A similiar topic was discussed here
    http://forums.ni.com/ni/board/message?board.id=170&message.id=151316#M151316
    Hope it helps

  • Tooltip for buttons on Confirmation Dialog Box

    Hi,
    How can we set the tooltips for buttons on the Confirmation Dialog Box.
    Pls throw some light on it.
    Rgds
    Shashank

    Found the solution:
    I Used 'ADMRadioGroupSuite1' Suite - RadioGroupSuite ("ADM Radio Group Suite") to group them. 

  • Code of confirmation dialog window

    Hi all,
          I have a component in which, I need to display confirmation dialog window when am trying to close a  window  with three buttons like YES,NO and CANCEL ...Its not like an pop-up window..can anybody provide source code for this..Thanks in advance

    Use Work Protect mode if you are running in Portal environment.
    SAP Online Help : http://help.sap.com/saphelp_nw70/helpdata/en/45/b76f4169e25858e10000000a1550b0/content.htm
    Thread which discuss the same :
    Re: Save Changes before leaving a web dynpro application

  • How I can internatiolization OK and Cancel buttons confirmDialog?

    private void clickButton() {
              int response = JOptionPane.showConfirmDialog(this, resBundle.getString("Confirmation_text_itroduction"),
    resBundle.getString("Confirmation_title"), JOptionPane.OK_CANCEL_OPTION,
                        JOptionPane.QUESTION_MESSAGE);
    if (response == JOptionPane.OK_OPTION) {
                   System.out.println("OK button clicked");
              } else if (response == JOptionPane.CANCEL_OPTION) {
                   System.out.println("Cancel button clicked");
    As you can see I internatiolization the title of confirm dialog and text (use object resBundle). OK!
    But how I can internatiolization OK and Cancel buttons is this confitm dialog?

    OK, I can internatiolization buttons "OK" and "Cancel" in confirm dialog:
    private void clickTestKindButton(String message) {
              Object[] options = { resBundle.getString("OK"),
                        resBundle.getString("Cancel") };
              int response = JOptionPane.showOptionDialog(this, message, resBundle
                        .getString("Confirmation_title"), JOptionPane.OK_CANCEL_OPTION,
                        JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
              if (response == JOptionPane.OK_OPTION) {
                   new IntroductionTest();
              } else if (response == JOptionPane.CANCEL_OPTION) {
                   System.out.println("Cancel button clicked");
         }It's work OK!
    But how I can internatiolization buttons "OK" and "Cancel" in the input dialog ?

  • How to disable the cancel button in InputDialogBox?

    Can someone please tell me how to disable the cancel button in an input dialog box?
    thanks,

    Cross posted: [http://www.coderanch.com/t/487888/Swing-AWT-SWT-JFace/java/disable-cancel-button-input-dialog]

  • Windows 7 Only Cancel Button at Clt+Alt+Del After 6500 Driver is Installed

    Hi,
    We have a fleet of X201 Tablet Laptops and We use the HP Officejet 6500 Printer.
    As soon as version 14.00 of the driver is installed on these machines upon restart rather than a username to click onto to login at Clt+Alt+Del a cancel button is displayed.
    The only work around we have found is to rebuild the laptop and then install an earlier version of the 6500 driver.
    What is causing this and how do we fix it as some users are installing the latest driver themselfs and breaking the laptops.

    The same thing is happening all over the hp forums.  People are updating printer drivers and then the printer doesn't work. Or some functions are taken away.  I have an hp 4280 printer and I'm still using the driver from when I first installed it. Every time hp wants to update, I say no. Mine still works perfect.  There have been 4 updated drivers since my version.
    It's not Lenovo and it's not your machine. It's hp's buggy drivers.
    T430u, x301, x200T, x61T, x61, x32, x41T, x40, U160, ThinkPad Tablet 1838-22R, Z500 touch, Yoga Tab 2 Windows 8.1, Yoga Tablet 3 Pro
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    If someone helped you today, pay it forward. Help Someone Else!
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • Icon in Confirmation dialog

    Hi everyone, I need help for my problem. I want do display confirmation dialog with icon and i find that i must using method setIcon(WDURLGenerator.getSAPIconWebResourcePath("???")). I have read the help about WDURLGenerator but still i cannot understand what parameter that i must use in this method (getSAPIconWebResourcePath(...)). I have try fill this methos with this : "~sapicons/s_b_disp.gif" but it not works. Anyone can explain this to me ? Thank you.
    Regards,
    Satria

    Hi ,
    For your actual question , it would be
         getSAPIconWebResourcePath("s_b_disp.gif") ;
    And as far as i know , using a ~sapIcons .. would inturn use the same function..!
    Maybe give this function a try ! Also , check if the sapIcons folder exists in the server
    usr/sap/...server0/ and then search for it ..
    Regards
    Bharathwaj

  • For "select-form" in the same page, add a cancel button in editing status

    Dear JHeadstart team
    For "select-form" in the same page, I still have a trouble.
    How can I customize the Tempalte File to make the editing page have cancel button to abandon the edit.
    If I want to learn the the JHS's Template costomizing (.vm file) and where can I find more reference documents about JHS's Template costomizing (excepting "Oracle JHeadstart 10g for ADF Developer's Guide").
    thanks!

    Can you be more precise on what you want:
    - should the cancel button be displayed when creating new row AND editing existing row?
    - when pressing the Cancel button, where do you want to go, to the select page?
    Steven Davelaar,
    JHeadstart Team.

  • Capturing the Cancel button with Before Print event handler

    I put together a script that is triggered by a beforePrint event handler. Everything works fine but I can't figure out how and where to capture the user clicking on the Cancel button in the Print dialog?
    Any ideas? Thanks, Dan

    Alen,
    My bet is you are using JDeveloper 11.1.1.5. This is a known ADF bug 12551764 in this release, not related to JHeadstart.
    Here are the details:
    http://adfbugs.blogspot.com/2011/05/jdeveloper-11115-serius-bug.html
    I just checked the bug database, it is fixed in patch 12399372. You can go to metalink to download the patch.
    Steven Davelaar,
    JHeadstart Team.

  • Cancel button on form of type form on a table or view

    I am a newbie for apex. I am using 10g. I have created form on table emp(empno , name , salary ) . Form is of type Form on a Table or View.
    Cancel & Save(Apply changes) button are not working at all. so I copied process reset page and execute on condition save button click. But still cancel button is not working. applcation has some other forms of type Form with a Report and are working properly. I have wasted 2 days on this problem.

    Hi,
    You can do that. If you have the branch to in the same form what you have to do use clear cache for that page. Click on the edit page, click on the cancel button in the left button section. scroll down to bottom and type the page 32 in the Clear cache field. However it is better to have branch to the report page (different page from the form).
    Hope this will help.
    M Tajuddin
    http://tajuddin.whitepagesbd.com

  • Creating a dialog box with OK and Cancel buttons without OADialogPage

    Hi Experts,
    i want to create a dialog box for Delete Confirmation means after clicking on delete it should pop up a small dialog box with OK/Cancel buttons
    and need code for the same to handle the buttons.
    i have created with OADialogPage but its showing in a complete page but i want to show those buttons in a small box.
    Plz help.
    THANKS IN ADVANCE.
    Thanks
    Raja.

    Hi,
    I have not tried using javascript in destination URI as suggested by Mukul.
    I have tried the below code for opening a page as dialog box.
    You can try it for your requirement by creating a dialog page of your own, say XXDialogPage (with OK and Cancel button)
    StringBuffer l_buffer = new StringBuffer();
    l_buffer.append("javascript:mywin = openWindow(top, '");
    String url = "/OA_HTML/OA.jsp?page=/xx/oracle/apps/fnd/dialog/webui/OADialogPG";
    OAUrl popupUrl = new OAUrl(url, OAWebBeanConstants.ADD_BREAD_CRUMB_SAVE );
    String strUrl = popupUrl.createURL(pageContext);
    l_buffer.append(strUrl.toString());
    l_buffer.append("', 'lovWindow', {width:500, height:500},false,'dialog',null);");
    pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
    In dialog page's controller, you can forward it to the page onc ethe user selects OK or Cancel.
    Pass the selected value back to the main page and further you can use it for deleting.
    Regards.

Maybe you are looking for