Confirm delete in command button

Hi All,
My use case is to show a javascript confirm box after hitting the delete
button(seems to be very basic use case). But whether I cancel it or press
OK , the actionListener fires and corresponding row gets deleted.(Using JDev
11g TP2).
I found two relevant forum links on that issue but one can get no idea from those links.
Those are
Re: af:clientListener and javascript confirm() dialog
RC client side events calling server side backing bean events
Do we have a solution for the above described use case?
Regards,
Ghosh

Hi Ghosh,
Do you have delete operation binding actionListener in 'Delete' button? I think that is your possible problem.
First at all, i supose that you have a af:popup with af:dialog to do the confirm box.
I propose you to create a button with one af:clientListener to call a javascript function. This function have to show the af:popup. The af:dialog have a dialogListener, it allows you to detect when you click any button inside the dialog. Inside the backing function, it's possible to kwon the button type. If the button is OK, do the delete operatin binding.
You have to know that If dialog is OkCancel type, this listener only is called if OK button is pressed (Cancel button doesn't call this function).
I think that this structure is a solution for your use case.
XerX

Similar Messages

  • Referencing a command button

    I have a Word (2010) template document which pops up a user form on Open.  The user form solicits info to go into the document and has a button allowing the user to post the info to the document, and then Save and Email it.   Or the user can
    click another button to just Save the document for editing and emailing later.  So, there is a command button in the document itself allowing the user to Email the document when it is finally ready.  I want to delete or disable the command button
    in the document if the user chooses to e-mail the document from the user-form.
    I can't figure out how to reference the button in the document.  I have tried ActiveDocument.Shapes("btnEmail").delete and ActiveDocument.InlineShapes("btnEmail").delete and .Enabled=False with and without quotes to no avail. In
    each case I get one or another error message about member not found or property or method not supported.  Shapes.Count returns 0 members, and InLineShapes.Count returns 3 members.  I have tried code to delete every member of the InLineShapes
    collection, and 3 items are deleted (a couple of horizontal lines and something else), but the command button survives.
    Any suggestions?
    Thanks,
    Peter

    Well, I deleted the command button and put it back.  It now appears in the Shapes collection where I can get at it. I can now enable/disable it with:
    ActiveDocument.Shapes(1).OLEFormat.Object.Enabled = True/False
    but only because it is the only (or at least the first) shape in the collection.  If there were more Shapes and I wanted to pick this one out by name I can use:
    Dim shp As Shape
    For Each shp In ActiveDocument.Shapes
            If shp.OLEFormat.Object.Name = "btnEMail" Then shp.OLEFormat.Object.Enabled = False
    Next
    Also, I discovered that in the Shapes collection, my button's name is "Control 5", so I can also use :
    ActiveDocument.Shapes("Control 5").OLEFormat.Object.enabled=true/false
    But if I have created the button with the name "btnEMail", it seems like I should be able to refer to it directly and not by having to loop through the Shapes collection to find it, and not by having to use debug.print to discover its Shapes
    collection name.
    I know that in Excel, I could reference a button on a worksheet very simply with:
    Sheet1.btnEMail.Enabled = True/False
    What am I missing that explains why Word is so different and cumbersome about this?
    Thanks,
    Peter

  • Trying to change the text of the command button.

    Hi.,
    Am using jdeveloper 11.1.1.6.,
    I have dragged and dropped a command button in my jsff page.
    When there is no record in my VO which dragged and dropped as a af:form the button will act as a create insert so that the text of the button should also be create Insert. If there is record the button should act as a update so that the text should also be update. I have used the follwoing code to change the text accordingly.
        public void settext(ActionEvent actionEvent) {
            // Add event code here...
            BindingContainer bc = getBindings();
            DCIteratorBinding dcIter =
                (DCIteratorBinding)bc.get("EssEeoDemInfView1Iterator");
            int e = (int)dcIter.getEstimatedRowCount();
            System.out.println (e);
            if ((e == 0)) {
                myButton.setText("CreateInsert");    // Null pointer exception occurs
            } else {
                myButton.setText("Update");  //null pointer exception occurs
        }Can any one pls help me?

    Hi Timo!
    This was the thing which i have did.
    I have dragged and dropped a command button to my jsff page.
    When i press the button a popup will show which ask the confirmation from the user.
    This is the code which i have written in my managed bean.
        public String delete_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Delete");
            Object result = operationBinding.execute();
            Commit();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public void deleteItem(DialogEvent dialogEvent)
            if (dialogEvent.getOutcome() != DialogEvent.Outcome.yes)
                delete_action();
              return;
          }I have used the EL Expression in my another button which will change it property according to the values in my row.
    #{bindings.EssEeoDemInfView1Iterator.estimatedRowCount gt 0 ? 'Update':'Create Insert'}For this button i have used the following code in my managed bean.
        public String update() {
             BindingContainer bc = getBindings();
            DCIteratorBinding dcIter =
                (DCIteratorBinding)bc.get("EssEeoDemInfView1Iterator");
            int e = (int)dcIter.getEstimatedRowCount();
            if ((e == 0)) {
                  CreateInsert();
            } else {
                   Commit();
            return null;
        }When i initially delete the record the button has not been changed to createinsert it remains as update. When i press the update am getting NULL pointer exception in CreateInsert() and Commit();

  • WbAdmin Delete Backup command not supported in 8.1 Pro x64

    Hello
    I've searched for how to delete specific backups that I've created using the elevated Power Shell command "wbAdmin start backup -backupTarget:E: -include:C: -allCritical -quiet" but I've run into a roadblock.
    The problem is that none
    of the "wbadmin delete xxx" commands are actually supported in Win8.1 Pro 64-bit (6.3, Build 9600). If I type "wbadmin delete /?", I get:
    ---- Commands Supported ----
    DELETE CATALOG                     -- Deletes the backup catalog.
    DELETE SYSTEMSTATEBACKUP  -- Deletes one or more system state backups.
    DELETE BACKUP                       -- Deletes one or more backups.
    However, when I try to use ANY delete command (for example, to delete a specific backup version that was identified using "Wbadmin get versions"), I get this error:
    PS C:\WINDOWS\system32> wbadmin delete backup -version:06/26/2014-07:29
    wbadmin 1.0 - Backup command-line tool
    (C) Copyright 2013 Microsoft Corporation. All rights reserved.
    Warning:  The DELETE BACKUP command is not supported in this version of Windows.
    The operation ended before completion.
    The same thing happens if I use -deleteOldest, with or without the -backupTarget switch.
    Does anyone know why the Delete command is not available on 8.1? Is there a patch, workaround or alternate method of deleting specific backup images?

    Yolanda, thank you for confirming the issue and for pointing me to a solution. I really appreciate it!
    I have looked at the cmdlet reference page tried to use the commands but it appears that they do not work on my system. For example:
    PS C:\WINDOWS\system32> remove-wbcatalog
    remove-wbcatalog : The term 'remove-wbcatalog' is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
    again.
    At line:1 char:1
    + remove-wbcatalog
    + ~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (remove-wbcatalog:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    Also, if I type the help command listed on the reference page, get-help -module windowsserverbackup, the only reponse is a blank command prompt. Do I need to install the windowsserverbackup functionality separately? It does not seem
    to be built-in.

  • Confirm delete in a report using href and img

    Hi,
    Found lots of references to this for buttons on a page, and a couple of others that are close - but my implementation of it just doesn't work for some reason.
    I'm presenting a user with a long list of items in an sql report, and against each line give them a delete option within the report. They want a confirm delete popup, so I have tried a few variations on:
    select
    '<a onFocus=''if (confirmDelete("Delete?")) location.replace("f?p=&APP_ID.:2:&SESSION.:DEL_EMP:::P2_DEL_EMP_ID:' ||emp_seq_num|| '");''
    href="f?p=&APP_ID.:2:&SESSION.:DEL_EMP:::P2_DEL_EMP_ID:'||emp_seq_num||'"><img src="/i/wdrop.gif"></a>' DEL,
    The message pops up, but the delete doesn't kick in.
    I've tried slight variations according to posts on the forum that result in it deleting even if cancel is selected, and yet others where the cancel and delete work, but if the button is clicked again - the delete just happens without a message.
    Not much hair left on the head at the moment.
    TIA.

    David,
    I have an example here:
    http://apex.oracle.com/pls/otn/f?p=31517:15
    However, this is not working for guest users. The code is on the page.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to create an ADF table which has a command button column?

    Hi
    Thank you for reading my post
    how i can create a tabl that one of its column is a command button.
    when i press the command button it will , for example delete that row or do some action.
    indeed i want to know
    -how to have a command button column
    -how to find the rowID or some row identifier that help me locate that row in the database.
    thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Rainer Wagner ([email protected]):
    Imagine a table T_Q with columns C_1, C_2, C_3 and UN_123.
    C_1, C_2 and C_3 are all numeric and given by the user.
    UN_123 has to be a calculated sequence number starting by 1 and incremented by 1 for each combination of C_1, C_2 and C_3, i.e., the sequence number depends on the key values C_1, C_2 and C_3.
    Could anybody provide a code sample on how to create a BEFORE INSERT trigger , which calculates the value of the column UN_123 based on the values of C_1, C_2 and C_3 ??
    Premise: Rather than using any sequence, the trigger code should only be based on the table T_Q<HR></BLOCKQUOTE>
    null

  • Save as command button

    Is it possible to have a command button that will do a "save as"?
    If so, how can I do this? (Need to make a form as simple as possible)
    Also, when inserting new fillable form fields I would like the field to show what they need to do in that field, such as entering a number, but when they do the instructions need to be removed when they type in the number.
    Example - inside the box it says "Enter Tag Number" - when they start to enter it only the number is in the box. They should not have to delete the message.
    Any help would be appreciated.
    Acrobat 9.0 Standard

    I just found the solution to the "save as" question.
    There is a command when you insert a button. When in properties you go to the Actions Tab then "Execute a menu item" and find what you need and then add it.
    Now all I need to do is find the answer to my other question.

  • Authorization object for Command Button

    Hi all,
    How can I create the Authorization object for command button which is on application server.
    if you do not have auth when you click on that command button, it should be say 'you dont have auth'.
    please help me in this.
    regards,
    Ajay reddy

    Hi,
    Tcode for Authorization Objects are,
    su20----> for defineing authorization field ,
    su21-----> for authorization class,
    su22------> for assignement authorization object
    To create an authorization object:
    1) Execute transaction SU21
    2) Double-click an Object Class to select a class that should contain
    your new auth object
    3) Click on CREATE (F5)
    4) (If creating custom field) - Click the 'Field Maintenance' button -->
    Click on CREATE (Shift+F1)
    5) Enter the Name for the New Authorization field and the corresponding
    Data Element and SAVE
    6) Confirm the Change Request data for the new Authorization Field
    7) Go back two screens (F3-->F3)
    8) Enter the Authorization field name and document the object:
    9) SAVE and ACTIVATE the documentation
    10) Save the new Authorization Object
    11) Confirm the change request data for the Authorization Object and
    EXIT SU21
    12) Finally, the SAP_ALL profile must be re-generated
    Regards,
    hema.

  • How do I get os x to stop asking for confirmation of a command?

    Ask anything, delete email, close a window, etc. and it constantly asks for confirmation. Any way to remove that?

    aussiedogs wrote:
    Ask anything, delete email, close a window, etc. and it constantly asks for confirmation. Any way to remove that?
    Confirmation of what command are you referring to?
    You can set the mail preferences so that trash is not stored in the trash, but deleted immediately.
    Most apps have preference settings to not ask for confirmation, such as Trash. Have you looked carefully at the preferences?
    Which windows ask you for confirmation requests when closing? Are you referring to 3rd party software? Also closing is not the same as terminating.
    Safari and FireFox only ask for confirmation, not when closing a window, but when closing the app, and then, only if more than one tab is open.
    Message was edited by: nerowolfe

  • Is there a way to make iphoto '09 have a confirm delete?

    Hi,
    New iMac/Apple user here, with a question. I have iphoto 09, and I imported my photos into the iphoto program (They were originally moved from a windows box to my mac desktop. iPhoto copied the files into its photo directory, and I deleted the old pics folder off the mac desktop. (I have it backed up tho). In iPhoto today, i mistakenly hit the delete button while browsing a pic, and deleted 2 pics from iPhoto. 2 Questions:
    1) Are the gone off the drive now? I believe it should go into "Trash," but s it actually gone off teh iphoto directory on the HDD?
    2) Can I make a confirm delete for that program, so when you delete, it says "Are you sure you want to delete this pic?" Then i can hit "ok" so i dont delete anyting else by mistake.
    -- my kids are too "touchy" with the keyboard, and the love looking at pics...i can imagine them hitting the delete button and deleteing stuff by accident.
    Thanks for your help.
    And i love the new mac BTW.

    A J Brutico
    Welcome tot he APple user to user assistance forums
    1) Are the gone off the drive now? I believe it should go into "Trash," but s it actually gone off teh iphoto directory on the HDD?
    It is in the iPhoto trash - in the source pane on the left - to delete from the hard drive you must empty the iPhoto trash - iPhoto menu ==> Empty trash - and it is good to do this every hundred photos deleted or so - iPhoto does not like to delete lots of photos at one time
    2) Can I make a confirm delete for that program, so when you delete, it says "Are you sure you want to delete this pic?" Then i can hit "ok" so i dont delete anyting else by mistake.
    No - but you can select photos in the iPhoto trash and right click (control click) and restore to library
    LN

  • Command button remains disabled after a request redirect to a PDF Servlet

    Hi All,
    I've a command button to generate PDF on the fly and used to work in JDev 10.1.3.3.
    When we migrated to 11g, it works for the first time on a page, and the file Open/Save dialog will come up.
    But then the command button remains grayed out, and clicking doesn't generate a server call.
    If I do something on the page which does a partial or full submit, then the button will get enabled again.
    Any suggestions?
    Thanks,
    Jaimon
    Sample code:
    Facelets:
    <af:commandButton text="Create PDF" action="#{fs02.createPDF}" />
    Java:
    public String createPDF() {
    //Validation checks here. If there are any errors, it gets added to FacesMessages to display on the same page.
    if(!validate()) {
    //sf.addInfoMessage('message here..');
    }else {
    FacesContext ctx = FacesContext.getCurrentInstance();
    HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
    HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
    RequestDispatcher rd = request.getRequestDispatcher("/pdfdownloader");
    rd.forward(request, response);
    ctx.responseComplete();
    return null;
    pdfdownloader is mapped as a servlet, which writes the actual PDF content as a stream.

    Herewith the code which is triggered with the post-forms-commit trg. As far as I can see it, there is no code to disable/enable the save button in the menubar.
    ===
    PROCEDURE validate_enbr_records IS
    CURSOR c_enbr
    IS
    SELECT exlb.exlb_length
    , enbr.enbr_ind_break
    FROM dog_envelop_breaks enbr
    , dog_extrnl_labels exlb
    WHERE enbr_appl_cod = :flow_appl_cod
    AND enbr_flow_cod = :flow_cod
    AND enbr_sort_seqnr <> :enbr_sort_seqnr
    AND enbr_appl_cod = exlb_appl_cod
    AND enbr_exlb_cod = exlb_cod;
    CURSOR c_exlb
    IS
    SELECT exlb_length
    FROM dog_extrnl_labels
    WHERE exlb_appl_cod = :flow_appl_cod
    AND exlb_cod = :enbr_exlb_cod;
    l_lengte_break_label NUMBER := 0;
    l_lengte_sort_label NUMBER := 0;
    l_length NUMBER := 0;
    l_aant NUMBER := 0;
    r_enbr c_enbr%ROWTYPE;
    mi_id MenuItem;
    BEGIN
    FOR r_enbr in c_enbr LOOP
    IF r_enbr.enbr_ind_break = 'Y'
    THEN
    l_lengte_break_label := l_lengte_break_label + r_enbr.exlb_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + r_enbr.exlb_length;
    END IF;
    l_aant := l_aant + 1;
    END LOOP;
    OPEN c_exlb;
    FETCH c_exlb INTO l_length;
    CLOSE c_exlb;
    IF :enbr_ind_break = 'Y' THEN
    l_lengte_break_label := l_lengte_break_label + l_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + l_length;
    END IF;
    IF l_lengte_break_label > 48
    THEN
    qms$errors.show_message('DOG-10194');
    END IF;
    IF l_lengte_sort_label > 50
    THEN
    qms$errors.show_message('DOG-10195');
    --set_record_property(3,'enbr',status,changed_status);
    END IF;
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    END;
    ===
    After the message has been throughn and the OK-button has been clicked, the code is never reaching the code:
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    The save-button remains disabled.
    Best regards
    John.

  • I just statred Flash CC for the first time and it seems that the text within the pop-up window (dialog box) is mis-aligned and not allowing me access to the command buttons, nor all the text. (ie: the NEW Template Box, can't see but 2/3 of the content)

    I just statred Flash CC for the first time and it seems that the text within the pop-up window (dialog box) is mis-aligned and not allowing me access to the command buttons, nor all the text. (ie: the NEW Template Box, can't see but 2/3 of the content) is there a fix to this problem? using 8.1, Monitor is a high res.2560x1440.

    Another View.
    the GUI is so hard to read (so small) I enlarge my Ps UI by the instructions below...which helped a lot.

  • I am attempting to upload multiple photos on a macpro from a cd.  I am used to a pc.  I tried using the command button to select multiples but it does not work.  Please advise

    I am attempting to upload multiple photos on a mac pro from a cd.  I have tried holding the "command"button down to select multiple photos but it does not work.  Please advise.  Thanks,John

    why not sort by (name, date, etc) and Click on 1st and Shift-Click on last.
    Might work better to copy or import to a project folder.
    https://discussions.apple.com/community/ilife/iphoto
    http://www.apple.com/support/iphoto

  • How to open new browser window on click of command button

    Hi,
    We have a requirement to open an image in new window when a command button is clicked. Is there any sample explaining how to do that?
    Thanks in Advance,
    Pradeep

    Hi,
    I have to load an applet viewer in the new browser window. I have URL to the PDF.
    I ma able to load the applet viewer in new browser window using javascript. But I have to load the new PDF if the same window in already opened.
    The issue here is , i am loosing the window handle if the parent page is refreshed. I want to store the window handle in session scope variable and use the same.
    How do i update the session scope variable using javascript?
    Thanks and Regards,
    Pradeep

  • How to get a form field valud in delete PL/SQL Button Event Handler

    Hi Friend,
    I have a form. when user clicks delete button. we want to remove system dodelete function
    and add a delete script
    Under delete-top category,
    how can I get value of form EVENT_NUMBER field in form at delete PL/SQL Button Event Handler?
    DELETE FROM PTEAPP.PTE_EVENTS WHERE eventnumber = EVENT_number
    But when I try to save this form and get message as
    1721/15 PLS-00201: identifier 'EVENT_NUMBER' must be declared
    Thanks for any help!
    newuser

    I did something similar but wasn't using a stored procedure. Couldn't you set a flag variable once you know you're not doing the insert and in the "before displaying the form" section put an IF to check if your flag was set, and if so do an HTP.Print('You are overpaid buddy!');
    Then just reset your flag.

Maybe you are looking for

  • 7.7  Unknown Error Message

    I installed 7.7 then after install, I plugged in my iPhone and got an error message that said +"iTunes could not connect to the iPhone "iPhone" because an unknown error occurred (0xE000001)."+ Now my phone won't do anything and has essentially become

  • Can I stream video to my wifi TV with Windows 8.1 on a Retina MBP

    I was able to do it once.  I was able to play video on my Sony HD TV from windows 8.1 in my 15" Retina MBP.  The next day, that option disappeared. How can I do it again? What do I need to do? I know I can do it with my Apple TV with itunes.  But I w

  • How to fix 'An Unknown error has occurred" when trying to save an  illustrator CS5 doc

    Hi I have just upgraded to a new iMac late 2013. After running a migration from my old mac to the new. I now have the following error: "Unknown error has occurred" when trying to save an illustrator CS5 doc. How do you  fix 'An Unknown error has occu

  • DVD Player problem - "supported disk not available" ?

    Hi all, Running DVD Player 4.6.5 on Tiger. Up until a while, everything was fine. Now, it won't play any DVD. It starts when I insert a DVD, but does not start playing automatically (which is what the setting currently is). When I start playing manua

  • Intalling a slide show that can be edited by contribute users

    I have developed a standardized template for a number of non profit organizations so that they can use contribute to update their websites without changing the template. Is there a way I could develop a slide show in dreamweaver and upload it so that