I want to have a confirmation dialog on close.

I am in JSP in one year.
I have forgotten a little bit of Swing.
I have an old project with this requirement, I need it quick, and I cannot find it on docs.
Can someone give me code snippet.
Thanks in advance.

Implement WindowListener in your Gui and in WindowClosing you show a JOptionPane and depending on the user's choice you either close the gui or do nothing.

Similar Messages

  • Conditional confirm dialog with button

    Hi all,
    I want to create a confirm dialog with submit button that can fire only if one item is not submitted in that page.
    i have one check box item in my page called P2_LWF
    i created confirm dialog with button using the below code
    javascript:if (confirm('Are you sure you want to proceed?')) {
    this.disabled=true; this.value='Submitted...';
    doSubmit('SUBMIT');
    The moment i click submit button i want to fire that confirm dialog only if P2_LWF is unchecked.
    How can i do that in my application?
    Regards,
    Anees

    Hi marko,
    find application link below
    http://apex.oracle.com/pls/apex/f?p=14972:1:25026364614886:::::
    user name: [email protected]
    pswd: symphony
    you can access my work space using below credentials
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    workspace : aneesmohd
    username : [email protected]
    paswd: symphony
    application name: Confirmation Dialog
    application id= 14972
    when i press submit button i can get the confirmation dialog,but i want to make that as conditional (only when dl and lwf checkboxes are not ticked).if those are ticked i want to submit without getting the confirmation dialog.
    and want to clear the employee region cashe(report region) ones submit button pressed or refresh the page.
    Regards,
    Anees
    Edited by: anees_mohd on Jan 16, 2013 3:25 AM

  • Could you tell me please why I could not do the upgrade from Adobe Lightroom 5 to Lightroom 6 ( standard version not CC ) !? I make the payment, I have the confirmation of payment, i have the license key, but when I want to download my upgrade, i receive

    Could you tell me please why I could not do the upgrade from Adobe Lightroom 5 to Lightroom 6 ( standard version not CC ) !? I make the payment, I have the confirmation of payment, i have the license key, but when I want to download my upgrade, i receive the message "413 Header Length too large". Thank you. Catalin Mihaescu from [email protected]

    Are you using Chrome? I noticed these errors on Adobe's website redesign using Chrome. Try a different browser.

  • When I try to exit a video on the internet I received a screen asking if I was sure I want to leave. It to not have a confirmation tag. But it has prevented Safari from shutting down. Now I can not turn off my Mac? How do I reset?

    When I try to exit a video on the internet I received a screen asking if I was sure I want to leave. It to not have a confirmation tag. But it has prevented Safari from shutting down. Now I can not turn off my Mac? How do I reset?

    What kind of videos are you watching? 
    You need to force quit Safari, but hitting Command-option-esc, and force quit Safari. 

  • How to applty setMneomonic in Confirm Dialog of JOption Pane

    hi I am using
    javax.swing.JOptionPane.showConfirmDialog(parentComponent,"Do you really want to Exit ? ","Confirm Exit",javax.swing.JOptionPane.YES_NO_OPTION);i know how to set the hot keys( setMnemonic(char)) in the JButton but i dont know how to use it in JOptionPane
    Also i want to take password input from JOptionPane.showInputDailog
    how i can call setEchoCahr('*');
    for input dialog
    thanks

    wht have you written in dialogListener="#{scheduleBean.deleteScheduleDialog}"..
    you dont have to go to viewRowImpl for deleting.. you can drag and drop the Delete operation from the corresponding ViewObject.. onto the jsf page as a button so that you will get the Delete operation in your pagedef..
    then you can call the delete operation from the dialoglistenr if the dialogue outcome is 'ok'
    public void dialogListener(DialogEvent dialogEvent)
    Outcome lOutcome = dialogEvent.getOutcome();
    if (lOutcome.equals(Outcome.ok))
    // get the binding container
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    // get an Action or MethodAction
    OperationBinding method = bindings.getOperationBinding("Delete");
    method.execute();
    List errors = method.getErrors();
    if (!errors.isEmpty())
    // handle error
    }

  • Displaying Multiple Sentences in Confirmation Dialog Box

    Hi Experts,
    Can anybody please tell me how to display three or multiple separate sentences in a Confirmation
    Dialog box. I am able to diaplay two sentences in a single line but the dialog box is getting stretched a
    lot. So i want to diaply them in separate sentences onr below the other.
    Thanks a lot.

    Hi shrini...
                   you want to number of line display in one dialog box ..
                  you have to declare one Strinh like thiss as below..
    have to create one event method as OK...which is visible in eventhandler code as
    findInEventHandlers("OK");
    create one method in component aas showBox....
    public void showBox( )
        //@@begin showBox()
         String   dialogText="welocme to""\n""India""\n".........................
          IWDEventHandlerInfo info=wdControllerAPI.getControllerInfo().findInEventHandlers("OK");
         IWDConfirmationDialog win=wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,info,"OKK");
      win.open();();
    thanks
    jati

  • Confirmation Dialog when clicking on Tree Node.

    I am working on Oracle Apex 4.2.0.00.27 and I have the following problem:
    The code below shows the definition of a tree. The tree displays records from the table ACTIVITIES in hierarchical structure.
    When user clicks on a leaf/node of the tree he will be redirected to another page where the details of each Activity/leaf/node are displayed.
    The tree is part of a page where I have established a functionality to check for changes on the input fields of the page and inform the user when he tries to redirect without first saving the changes he made.
    What I want to do is:
    WHEN user clicks on a node of the tree AND he hasn't saved any changes he made
    THEN
    trigger a confirmation dialog.
    IF
    he clicks OK he is redirected to the node details page as defined on the tree definition:
    f?p=&APP_ID.:10:'||:APP_SESSION||'::::P10_ID:'||"ID"
    ELSE if he clicks CANCEL
    he stays on the same page.
    The condition to trigger the confirmation box is:
    if (document.getElementById('P0_CHANGES_DETECTED').value == 1)
    where P0_CHANGES_DETECTED is a universal hidden text field that is set to +'1'+ every time a change is made.
    and here is the tree definition:
    select case when connect_by_isleaf = 1 then 0
    when level = 1             then 1
    else                           -1
    end as status,
    level,
    +"NAME" as title,+
    null as icon,
    +"ID" as value,+
    null as tooltip,
    decode(PARENT_ID,null,null, 'f?p=&APP_ID.:10:'||:APP_SESSION||'::::P10_ID:'||"ID") as link
    from "#OWNER#"."ACTIVITIES"
    where GROUP_ID = :P20_GROUP_ID
    start with "ID" in (select ID from "#OWNER#"."ACTIVITIES" where GROUP_ID = :P20_GROUP_ID and PARENT_ID is null)
    connect by prior "ID" = "PARENT_ID"
    order siblings by "ID"
    I hope it is clear what I want to achieve. Thanks in advance.

    So you'll want to bind an event to all tree nodes that checks for the value and then fires the confirmation if there value is 1.
    Try something like this:
    - first, give your static ID attribute in your tree the value of tree_static_id (or whatever you want. just replace the id selector below with what you choose).
    - In your Page Function and Variable Declaration Javascript:
    function confirmSave() {
    var changeDetected = jQuery('#P0_CHANGES_DETECTED').val();
    if(changeDetected == 1) {
    //only do this if change is detected
    if(confirm('You have unsaved changes. Do you want to leave this page?')) {
    window.location('[your url here]');
    jQuery(document).ready(function() {
    //bind function to the click event
    $('#tree_static_id').find('li a').bind('click', function() { confirmSave(); } });
    });Hope this helps

  • 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
    >

  • 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

  • Re-enabling confirmation dialog box when deleting playlists

    When deleting a playlist, a confirmation box will appear and also the option to no longer see the confirmation box. I enabled this option. I no want to see this confirmation box again. How can I re-enable it? I couldn't find anything in the .plist file.

    Ok, I got the dialog back. If you discard the preference file, it restores all the dialogs. But they really should add a way to change that without redoing your prefs. (Not a big deal, it takes you through most everything when you re-open iTunes.) Note, the dialog only shows up with playlists that have songs in them – empty ones just delete.
    Close iTunes, delete this file:
    /Users/<USERNAME>/Library/Preferences/com.apple.iTunes.plist
    Reopen iTunes, follow dialogs to reset preferences.
    Sure wish you could just "undo."
    One place they figured it out: http://discussions.apple.com/thread.jspa?messageID=6046139&#6046139

  • Confirmation Dialog Box

    Hi All,
    With ADF UIX, what is the recommended way to implement a confirmation dialog box to get user's confirmation before an action is actually executed? Any UIX element like <messagebox>?
    Thanks.
    Elton.

    Elton,
    The best examples we have publicly available are at http://download.oracle.com/otn/nt/ids/uix/217/uix-demo-2.1.7.zip
    (I hope the link still works)
    This is for UIX 2.1.7, which is what ships with JDev 9.0.3. You'll want to do some things a bit differently if developing with UIX 2.2 in JDeveloper 10G.
    Hope this helps,
    Ryan

  • Centralizing standard Confirmations Dialog in external Component

    Hello Community,
    i'm developing on an application consisting of several different development-components, each containing again different wd-components. the component design of wd is a great advantage for reuse components.
    but i still have a problem to achive better reuseability.
    so i have one development-component which contains a component which at the moment contains methods (in the component-controller of that component) for outputing standard-messages. no view controllers or windows are defined.
    But i also have some Stanard-Confirmation Dialogs which i want to reuse.
    So i declared a new method in that central component-controller which i also declared in the interface controller of the component:
      //@@begin javadoc:dialogWarningNotYetSaved()
       * Method declared by application.
      //@@end
      public void dialogWarningNotYetSaved( com.sap.tc.webdynpro.progmodel.api.IWDAction contUnsavedEvent, com.sap.tc.webdynpro.progmodel.api.IWDAction contSavedEvent, com.sap.tc.webdynpro.progmodel.api.IWDAction abortEvent )  {
        //@@begin dialogWarningNotYetSaved()
           IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
           msgMgr.reportMessage(IMessageMessages.NOT_YET_SAVED, null);
           String dialogText = wdComponentAPI.getTextAccessor().getText(IMessageMessages.NOT_YET_SAVED, null);
           IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText, contUnsavedEvent, "Continue Unsaved");
           dialog.addChoice(contSavedEvent, "Save and Continue");
           dialog.addChoice(abortEvent, "Abort");
           dialog.show();
        //@@end
    The main problem is, that the dialog does not return a value but instead does fires an action or event, attached to a choice.
    But it seems, that such an event has to be one declared in the component. But i want to call the method containing the Confirmation-Dialog from another component and so, in my opinion, it has to trigger the event or action in the calling component. to reach this, i put the actions into parameters of the central method in the external component and put this action-parameters in the dialog.addChoise Method.
    But doing so, WD-Runtime throws an exception, that the actions are not known in the repository of the component???
    does anybody has an idea what i have to do to make it work correctly?
    regards and thanx in advance
    Matthias

    Hi,
    Create one event "SaveAndContinueEvent" with some parameters in your Common Component's Component Controller.
    SaveAndContinueEvent(String param1, String param2).
    And create one more method as "saveAndContinue(String param1, String param2)" in the same Component Controller with same parameters and
    fire the event "SaveAndContinueEvent" in that method as below.
    wdThis.wdFireSaveAndContinueEvent(param1, param2);
    Now in the "contSavedEvent" event handler of the View invoke the method saveAndContinue() of Component Controller as below.
    wdThis.wdGetCommonCompController().saveAndContinue(param1, param2);
    Now in the Other Components, from where you are invoking this Common Component to open the dialog box, in the corresponding Views create the eventHandler as
    "SaveAndContinueEventHandler" and while creating this eventHandler select "SaveAndContinueEvent" of Common Component as a source event to that eventHandler.
    Now when ever user clicks on SaveAndContinue button the "SaveAndContinueEvent" event of Common Component will be fired and that even will be handled by "SaveAndContinueEventHandler" of the main view.
    Regards,
    Charan

  • Disable the AirDrop confirmation dialog?

    I frequently use AirDrop to transfer files between iMac and MBA. Is there any way to disable this annoying confirmation dialog, as I am on a secure home network?

    Thanks for your input. I currently have both iMac and MBP set to share over the network, but they seem to only want to connect about 50% of the time...when they don't want to communicate, I can usually use AirDrop, I just would prefer to skip the confirmation dialog (I know you can set the Shared Disk setting to not ask for confirmation)

  • Best approach to implement reusable confirmation dialog ?

    Hi,
    What's the best approach to implement reusable confirmation dialogs with ADF 11g?
    e.g.: "Do you realy want to delete this client record (yes/no)?" should be used on several pages but with different message text.
    Also I have to know in the calling page which button (yes, no, ...) the user has pressed in the af:dialog.
    If it's af:popup is it possible to place af:dialog within page template to avoid placing af:popup within each page?
    regards
    Peter

    Hi,
    What's the best approach to implement reusable confirmation dialogs with ADF 11g?
    e.g.: "Do you realy want to delete this client record (yes/no)?" should be used on several pages but with different message text.
    Build a declarative component
    Also I have to know in the calling page which button (yes, no, ...) the user has pressed in the af:dialog.
    You can do this through a method reference in a declarative component. Its a method on the calling page's managed bean that is invoked from the declarative component
    If it's af:popup is it possible to place af:dialog within page template to avoid placing af:popup within each page?
    May not make sense but should be possible
    Frank

  • Confirmation Dialog in 10g

    hi all,
    i 've a Delete button(af:commandbutton) on page. its 'action' attribute is associated with a method in bean.
    <af:commandbutton action="#{abcbean.delete_action}"/>.
    how i put a modal confirmation dialog on button like, 'Are u sure want to delete ...?' with yes-no button.
    when user presses 'yes' on dialog, method in bean would invoke. when presses 'no' remain on same page.
    i m using jdev10g.
    thanks with regards to all

    hi you can call a popUp(Dialog) and execute the code later with the returnListener property of that button
    the returnLietener have an object call ReturnEvent in this object allow Map objects
    example code:
    jsp commandButton java Action code:
    Map param = null;
    param = new HashMap();
    param.put("Yes","Ok");
    AdfFacesContext.getCurrentInstance().returnFromDialog(null,param);
    returnListener Method:
    public void handleReturnBuscar(ReturnEvent returnEvent) {
    Map param = (Map)returnEvent.getReturnParameters();
    if(param !=null){
    //delete the row
    more info = http://soadev.blogspot.com/2010/02/adf-faces-rc-simple-but-robust.html

Maybe you are looking for

  • Acrobat Pro 9 - Comments and Stickies vanish and reappear when clicked!

    Very strange problem, I'm having. If I add comments, stickies or callouts to a PDF, everything is great UNTIL I click off of the item being created. The item immediately disappears with no indication that anything is there (ie: a sticky "bubble" icon

  • Prob with running jsp Bean

    Hi, I am trying to run a bean through a jsp but its giving error at useBean tag of jsp: The error is : HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this requ

  • Problems with XML import to PDF form esp. checkboxes

    I am posting this here because it was suggested to me to do so when I posted it here: http://forums.adobe.com/message/5613723 Hi, I work with a certain PDF form created by the US government. They recently "upgraded" the form. (N600K) With the old for

  • Sincerity, will make Aperture better

    I like to help apple do it better.. in order to do that apple dos't have to be mean to clients specially when I am in the middle of something important and they deleted my discussion, probably my writting english is not at is best, sorry I don't have

  • Need a copy of TUX 6.5 for Solaris 8

    can anyone help? please email me... [email protected] thanks, Mario