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

Similar Messages

  • JavaScript Confirmation Dialog on Button

    Hi all,
    I have a Back Button which triggers the following JavaScript Function:
    <script language="javascript">
    function backConfirm() {
         msg = "<%=res.getString("BACK.CONFIRM")%>";
         return confirm(msg);
    </script>
    The function gets called in my Back button using:
    <hbj:button
         id="button_back"
         onClick="onBackButtonClicked"
         onClientClick="backConfirm()"
         width="100"
         design="EMPHASIZED">
         <%
         button_back.setText(res.getString("BUTTON.BACK"));
         button_back.setTooltip(res.getString("BUTTON.BACK.TOOLTIP"));
         %>
    </hbj:button>
    Now, the problem is that
    onBackButtonClicked
    is always called, regardless of the button clicked in the confirmation message.
    How can I solve this?
    Kind regards,
    Francisco

    You need to use the cancelSubmit method to prevent the onClick method from being invoked.
    From the button documentation.
    onClientClick    
    Defines the JavaScript fragment that is executed when the user clicks on the button. If both events ('onClick' and 'onClientClick') are specified, the 'onClientClick' event handling method is activated first. By default the 'onClick' event handling method is activated afterwards. In the JavaScript fragment you can cancel the activation of the 'onClick' event handling method with the command
    htmlbevent.cancelSubmit=true;
    The 'onClientClick' event is useful to pre process the form and only send the form to client if the preprocessing was successful (for example, date validation, valid number format etc.) to save client/server interaction.

  • 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

  • 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

  • Confirmation dialog for rich menu

    Hi,
    I am trying to get a confirmation dialog box to be opened from a rich menu item
    I was able to provide the the confirmation dialog to button, but none of the solution seems to be working for menuItem.
    Have anybody faces a similar issue?
    Please help ...
    Thanks in Advance
    Shaiju

    shamili wrote:but none of the solution seems to be working for menuItem. Which solutions you tried?
    It will be better if you add code snippet, in relation to your question.

  • Confirmation dialog-native window

    Hi,
    how can i create native yes/no confirmation dialog with air
    window component like titlewindow with popup manager?
    Thanks

    Hi,
    how can i create native yes/no confirmation dialog with air
    window component like titlewindow with popup manager?
    Thanks

  • Close ADF Popup Dialog with html button in Inline Frame

    hi,
    I'm using jdev 11.1.1.2,
    I have a adf popup dialog which contains an Inline Frame(source is a jsp file).I want to close the dialog with a html submit button in the frame page. when the submit button is clicked, auto close the dialog.
    can anyone help in this.
    Thanks

    Try to close the popup from Javascript using a sciptlet similar to the following one:
    var popup = AdfPage.PAGE.findComponent('<yourPopupClientId>');
    if (popup.isPopupVisible()) {
      popup.hide();
    }where <tt><yourPopupClientId></tt> should be replaced with the popup's client ID. The client ID is composed of the popup's ID from the <af:popup> tag preceded with IDs of the eventual parent naming containers where the popup has been declared.
    For example, if the tag is <tt><af:popup id="myPopup"></tt>, then the clientId might be:
    <tt>  myPopup
      container1:myPopup
      container1:container2:myPopup</tt>
    ... and so on, depending on where you have defined the popup in your JSF page (i.e. within which naming containers), you should determine it first.

  • Popup dialog with 3 button

    does anyone know any FM which provides popup dialog with 3 button?

    hi Oscar,
    you can try:
    POPUP_WITH_3_BUTTONS_TO_CHOOSE
    hope this helps
    ec

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

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

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

  • Plugin fails to display modal dialog with ActiveX'ed bean

    I have first posted this in the ActiveX bridge group, and have gotten no response. Since the plugin group also has posts on modal dialogs, thought this is also correct to post here. Both plugin and ActiveX'ed beans use beans.ocx for display.
    I have a bean wrapped as ActiveX with sun.beans.ole.Packager. The bean provides a method, which ultimately will pop up a modal confirm dialog (JOptionPane.showConfirmDialog(.)).
    If the method is triggered solely from within the bean, say via a click on a bean's button, all is well.
    If the method is triggered from its host (VB form), the
    - the call is done on the main thread. The confirm dialog shows, but when I click on one of its buttons, the app hangs.
    - If I try to pass the call into the event dispatch thread (SwingUtilities.invokeAndWait(.)), the confirm dialog somewhat pops up, but does not paint completely and the app hangs.
    - If I try to pass the call into the event dispatch thread with SwingUtilities.invokeLater(.) all is well, the confirm dialog pops up, I can click on its buttons, etc. but the function returns to VB too early, which is not what I want since I need the answer.
    - I have tried the following:
    entry method determines it is not on the event dispatch thread.
    Tries itself with invokeLater(.), yields the current thread and calls wait(.).
    The method invoked later will execute in the event dispatch thread, popup the confirm dialog and when finished will do a notifyAll(.).
    Unfortunately, what happens is that the entry thread (the main thread) puts the invokeLater into the event dispatch queue, yields itself and wait()'s. And waits and waits. In the meantime, the dispatch thread will get to the point where it wants to show the confirm dialog, but will then hang. If I time out the wait in the main thread, then the confirm dialog is popped up immediately after the wait finishes with the time-out.
    Sooo, this tells me that there is some strange synchronization going on which causes something like a deadlock. Is there any good approach to triggering modal dialogs from a native app hosting the ActiveX'ed bean??
    I have found many entries on probs with modal dialogs in the plug-in, which relate to applets. But no solution yet.
    Some keywords that I have came across are:
    - the event dispatch queue can be flushed and "empty events" can be posted into it. Also, the invokeAndWait(.) will register a "conditional" message pump on the event queue that seems to work until the locking condition is no longer valid. Any experience with these? Any way to manipulate (a) main thread, (b) event dispatch queue, (c) event dispatch thread to resolve the apparent deadlock?
    - There seems to be some difference in locking when the parent process is VB/COM as when it is Java. I have the impression that the main thread has some lock until the call made from VB/COM is fully completed and the call stack cleaned up. Can anyone confirm this? And/or suggest a way around it?
    Sylvia

    Sylvia - I found your posting because I have a similar problem in which a JavaBean wrapped using the Packager needs to call a Visual Basic event subroutine from a thread other than the main thread.
    This, I have discovered, is not supported in VB unless you use special thread marshalling calls (not available to the Java bean) or event queuing calls (ditto, afaik).
    My point is that this may be related to your problem. Check this Microsnot document on their public support site:
    Q196026

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

  • 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

Maybe you are looking for

  • PWLK400 unconfiguarable

    I bought a dual kit PWLE400 and PWLK400. On installing the utility I can see the PWLE and configure it easily, but the PWLK is not appearing on the utility. It is however plugged into the network and transmitting a wireless signal. On virgin media us

  • Re: (forte-users) Arrayfields & Tabbing

    I believe Ctrl-Tab will take you forward out of the arrayfield and to the next widget. We have some accessability code in our base window class to handle various special keyboard commands, but I think Ctrl-Tab is standard in Forte. (of course I've be

  • How to detect end of a html

    hi, Can anyone help me to determine how I can know if a html document has been displayed in a JEditorPane?

  • RFC vs NonSingleton Node

    Dear all,   I need to retrieve a list of order with relevant items. The application will display a list with order header data and, on lead-selection, a detail view view with header details and positions data.   What I need to know is if it is better

  • I seem to be having trouble "save" or "save as" with jpg files. Any Suggestions?

    I seem to be having trouble "save" or "save as" with jpg files. Any Suggestions?