Confirmation Dialog Problem

Hello!
I am facing a peculiar problem in the production system where in the confirmation dialog isn't working and the NullPointerException is getting thrown. For some reason the production server isn’t getting the handle for the event even though they are defined and the same piece of code is working fine in both Dev & QA.
Could someone look into the code and let me know what I can do to make it work.
    try
          String dialogTxt =     "Are you sure you want to ignore changes? ";
          IWDEventHandlerInfo eventIgnore               =     wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("evtIgnoreChanges");
          IWDConfirmationDialog dialog               =     wdComponentAPI.getWindowManager().createConfirmationWindow(dialogTxt,eventIgnore,"Yes");
          IWDEventHandlerInfo eventIgnoreCancel     =     wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("evtIgnoreCancel");
          dialog.addChoice(eventIgnoreCancel,"No");
          dialog.setWindowPosition(WDWindowPos.CENTER);
          dialog.setWindowSize(250,50);
          dialog.open();
    }catch(Exception ex)
         wdComponentAPI.getMessageManager().reportException("Error ignoring changes",true);
         ex.printStackTrace();
Thank you very much in advance.
Regards,
Vikram

Hi,
Use this code:
IWDControllerInfo controllerInfo =
        wdControllerAPI.getViewInfo().getViewController();
      String dialogText = "Are you sure you want to ignore changes?";
      IWDConfirmationDialog dialog =
        wdComponentAPI.getWindowManager().createConfirmationWindow(
          dialogText,
          controllerInfo.findInEventHandlers("evtIgnoreChanges"),
          "Yes");
      dialog.addChoice(
        controllerInfo.findInEventHandlers("evtIgnoreCancel"), "No");
      dialog.open();
check if you have created events with name evtIgnoreChanges & evtIgnoreCancel in your view controller.
Regards,
Rajeev

Similar Messages

  • 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

  • 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

  • Multiple Confirmation dialog boxes event handling

    Hi all,
    I had a scenario, where i need to display two confirmation dialog boxes based on timers.
    At the first timers timeout confirmation dialog box poped up and user haven't done anything.
    second confirmation dialog popup appears after second timer timeout.
    But, my problem is closing or destroying the first dialog box, when handling the second dialog event or before second dialog popup on screen.
    Can anyone suggest the best approach to handle dialog destroy functionality.
    regards,
    Venkat

    hi!
    also refer to this link if you are going for dialog windows
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/903fed0d-7be4-2a10-cd96-9136707374e1
    thanks
    vishal

  • 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

  • Poping Up a Confirmation Dialog

    I would like to popup a confirmation dialog when a user clicks a 'cancel' button in my page. If the user clicks 'NO' in the dialog, data is not cleared and navigation is canceled.
    I tried this ...
    public String cancelBtn_action() {
            int i = JOptionPane.showConfirmDialog
                        (null, "Do you really want to clear all data and start over?",
                            "Warning", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
            if(i == JOptionPane.YES_OPTION) {
                getSessionBean1().clearBeans();
                return "clear";
            else return "null";
        }... but the dialog is hidden behind all the open windows on my machine (b/c the 'null' argument in showConfrimDialog, I guess).
    Can I attach this dialog to the page somehow (so it does not get hidden)? Should I even use Swing? Is there a prefered way to use popup dialogs in JSF/Creator?
    Any information would be much appreciated.

    Thank you for your reply.
    Pardon any redundancy, but to be sure that I am making myself clear and that I am understanding your response...
    At first 'cancel_action()' ( event handler in the page bean) looked like this:
    public String cancelBtn_action() {
           getSessionBean1().clearBeans();
           return "cancel";
    }To make this code conditional I next tried this:
    public String cancelBtn_action() {
            int i = JOptionPane.showConfirmDialog
                        (null, "Do you really want to clear all data and start over?",
                            "Warning", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
            if(i == JOptionPane.YES_OPTION) {
                getSessionBean1().clearBeans();
                return "cancel";
            else return "null";
    }This code works 'fine', except that the dialog gets displayed behind all open windows where the user can not see it. (If there is a way to tie the dialog to the browser frame so it does not get buried (maybe there is?), this would allow all the JOptionPane stuff to be leveraged nicely with JSF).
    Since you are not modifying any data based on the
    response received from confirmation dailogclearBeans() clears data previously entered in several session-scoped beans (so data is (conditionaly) modifed). "cancel" and "null" are different navigation cases
    I would suggest to use javascript based dialogs. I like the simplicity of using javascript, but I need to set a flag (or something similar) in my page bean to conditionaly control navigation and whether to clear data stored in the session beans. This seems to require that the javascript calls a method in the page bean. Can this be done with JSF?
    >
    You can also use another jsp page in a popup as
    confirmation dialog by specifying the size of the new
    page.
    So I guess you mean a non-JSF JSP page? Since I need to finish executing the code in the event handler that was interupted by the confirmation dialog, I think that JSF navigation/lifecycle issues would be a problem. Am I correct?
    Again pardon any redundancy.
    More details on either (or any other) approach would be helpful.

  • 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

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

  • Confirmation Dialog Box Appears Disappears

    Hi,
    I am facing a problem here on Same os win 98 using different versions of Java run time environment.
    The code is supposed to work in this way.
    Applet is initiated by a click. a confirmation dialog box appears askign for input from a user in the form of a Yes or a No. if the user clicks Yes the applet continues otherwise it terminates.
    while using 1.4.1_02 This problem occurs that the Confirmation dialog box appears and then disappears for the jar is being downloaded.
    But using 1.3.1_04 gives no problems and the Confirmation box does not disappear.
    Regards,
    Saurabh

    Hmmm, are you running 10.6.8 or later & installed the Security updates?
    Java was an attack vector for FlashBack.
    Disable Java in your Browser settings, not JavaScript.
    http://support.apple.com/kb/HT5241?viewlocale=en_US
    http://support.google.com/chrome/bin/answer.py?hl=en-GB&answer=142064
    http://support.mozilla.org/en-US/kb/How%20to%20turn%20off%20Java%20applets
    Flashback - Detect and remove the uprising Mac OS X Trojan...
    http://www.mac-and-i.net/2012/04/flashback-detect-and-remove-uprising.html
    In order to avoid detection, the installer will first look for the presence of some antivirus tools and other utilities that might be present on a power user's system, which according to F-Secure include the following:
    /Library/Little Snitch
    /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
    /Applications/VirusBarrier X6.app
    /Applications/iAntiVirus/iAntiVirus.app
    /Applications/avast!.app
    /Applications/ClamXav.app
    /Applications/HTTPScoop.app
    /Applications/Packet Peeper.app
    If these tools are found, then the malware deletes itself in an attempt to prevent detection by those who have the means and capability to do so. Many malware programs use this behavior, as was seen in others such as the Tsunami malware bot.
    http://reviews.cnet.com/8301-13727_7-57410096-263/how-to-remove-the-flashback-ma lware-from-os-x/
    http://x704.net/bbs/viewtopic.php?f=8&t=5844&p=70660#p70660
    The most current flashback removal instructions are F-Secure's Trojan-Downloader:OSX/Flashback.K.
    https://www.securelist.com/en/blog/208193454/Flashfake_Removal_Tool_and_online_c hecking_site
    More bad news...
    https://www.securelist.com/en/blog/208193467/SabPub_Mac_OS_X_Backdoor_Java_Explo its_Targeted_Attacks_and_Possible_APT_link

  • 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

  • File download element in confirmation dialog box

    Hi,
    Can I use File Download elements in Confirmation Dialog Box?Please raply me as early as possible.
    Regards
    Aniruddha

    Hi
    You can not use  File-Upload UI element inside confirmation dialog ,because there is no provision to add any UI ,except Button.
    Please avoid  my previous reply .
    Best Regards
    Satish Kumar
    Edited by: satish jhariya on Mar 3, 2009 11:29 AM

  • 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

  • Is there an easy way to implement a confirm dialog?

    Hi All,
        I'm wondering is there an easy way to show an confirm dialog to user with out create a new view manually?
        Thanks,
    YiNing

    Hi ,
    use the below code for confirmation box , with 2 options "OK "
    and "Cancel"
    IWDControllerInfo controllerInfo =     wdControllerAPI.getViewInfo().getViewController();
    IWDConfirmationDialog dialog =     wdComponentAPI.getWindowManager().createConfirmationWindow
                                    ( String dialogText,controllerInfo.findInEventHandlers                                ("ok"),"Ok");
                        dialog.addChoice(controllerInfo.findInEventHandlers                                          ("cancel"), "Cancel");
                        dialog.open();     
    Thanks,
    Sunitha Hari

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

  • 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

Maybe you are looking for