Delete button control: Javascript confirm & redirect?

Hello all,
I have a contract details page that has the following buttons: Save, Cancel, Delete. The Cancel button has a general redirect assigned to it, since no processing is necessary. As for the Save button, the page submits to itself, so the screen just reloads quickly, with a note to show the record was updated. As for the delete button, I don't want the user to remain on a details page for a contract they just deleted, so I wish to redirect the user to my contract search page after the record is deleted. I also want to have the button confirm the deletion before proceeding.
My current page setup is as follows:
SAVE button (template based)
Optional URL Redirect - No Target
DELETE button (template based)
Optional URL Redirect - Page 3 (contract search)
"Request" and other fields here are empty
CANCEL button (template based)
Optional URL Redirect - Page 3 (contract search)
"Request" and other fields here are empty
BRANCHES Information:
Before Validation:
DELETE:
Target type - page in application (3 - contract search)
Request - DELETE
When Button Pressed - BTN_DELETE
After Processing:
Target type - page in application (2 - contract details)
When Button Pressed - BTN_SAVE
Here's my dilemma...under the setup listed above, clicking Delete redirects me to the search page, but the record is not deleted (I do have a DML process set up for Insert/Update/Delete, set up for After Submit). I've tried changing both the button and/or branch properties to set up URL processing, entering javascript to confirm the deletion. No matter the combination I use, either the contract will not get deleted, or the deletion is a success, but I get an error message that there is no branch page set up for that. If anyone has suggestions as to how I can get validation to play nicely with deleting records, it would be much appreciated.
Thanks,
Brian

Mike,
Is it possible that you have more than 1 branch to the target page? yes I do, before I had the Unconditional branch on top. Now I moved the conditional branch to the top. Redirect is working fine but no luck with passing values. After some research I found that it passes the request value when I send it as a string but not as value of the item on page. This may have something to do with in-built Delete procedure.
I am very new to Apex/Oracle and I don't know how to create a oracle workspace and post my App on line. So, I am giving a detailed description of what I am trying to achieve. please bear with this while I try to figure out how to post it on line.
This is exactly what I am trying to do.
On the first page I have multiple regions to show different reports based the user selection. User clicks a button to make a selection. I am toggling between the regions depending on the request value from the button click.
If the user decides to modify a record he is directed to a form. After modifying I want the user to come back to the first page and be in the same region where he was initially.
To achieve this
--- I am passing the request value from the first page to the form and saving it in a hidden variable. In the unconditional branch I am passing that value back and it is working fine.
--- Only for the Delete operation I have problems. I still want to have the Alert so I am using the javascript:confirmDelete(htmldb_delete_message,'DELETE'); in the Delete button URL.
I created a conditional branch which has lower sequence than the unconditional one.
I have set the condition as Request = Expression 1(DELETE) not the button click.
In the Action part, i have the following
Target type Page in this Application
Page: 21
Request: &P21_Old_Request.
Clear Cache
Set these items P21_Item1
With these values &P22_Item1.
I have seen that page redirect is working fine.( I tried to redirect to other pages it works fine). Only the values are not passed. I tried to pass these values as Application level items even then it doesn't do anything. But if u pass the string directly it would pass the string. But I want to be able to pass the value as an Item from the form.
As I mentioned before it may be to do something with in-built Delete procedure.
Is there way to see the SQL of that procedure?
Do u have any suggestions for me?
Thanks in Advance.
Nimmi

Similar Messages

  • Javascript Confirm Redirect

    I am looking to figure out how to do a javascript confirm
    Redirect popup. Can anyone help me out with that? Is there a
    Dreamweaver behavior for that?

    I'm not sure exactly what you mean, but it's easy enough to
    make a popup (to
    open a second sized browser window) by using DW's Open
    Browser Window
    behavior.
    Patty Ayers | www.WebDevBiz.com
    Free Articles on the Business of Web Development
    Web Design Contract, Estimate Request Form, Estimate
    Worksheet
    "joey_a" <[email protected]> wrote in
    message
    news:edbo7j$iea$[email protected]..
    >I am looking to figure out how to do a javascript confirm
    Redirect popup.
    >Can anyone help me out with that? Is there a Dreamweaver
    behavior for that?

  • How to delete an Item using Button control in InfoPath 2010

    Dear Experts
    In my SharePoint 2010 List, I have added and using below controls instead of Ribbons
    1) Save (button control)
    2) Cancel (button control)
    3) Delete (button control)
    My requirement is when i click on Delete (button control) in edit form then particular item has to be deleted
    How to achieve this
    Regards
    Santosh

    Hi Santosh,
    Please check this 
    http://www.bizsupportonline.net/browserforms/delete-sharepoint-list-items-object-model-infopath-browser-form.htm
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Custom Save / Apply Changes / Delete buttons...

    Hi All,
    I wanted to make a custom save / apply changes and delete buttons in my forms. Therefore I wrote some JavaScript functions to call these actions as shown below;
    function saveRecord(pListPage){
    if (P&APP_PAGE_ID._CALLACTIONTYPE!= 'CANCEL') {
    if (P&APP_PAGE_ID._CALLACTIONTYPE!= 'DELETE'){
    doSubmit(P&APP_PAGE_ID._CALLACTIONTYPE);
    lvurl = 'f?p=&APP_ID.:' + pListPage+ ':&APP_SESSION.::NO:' + pListPage+ ':P' + pListPage+ '_CALLTYPE' + ',P' + pListPage+ '_CALLFROM,P' + pListPage+ '_SELECTEDRECORD,' + 'P' + pListPage+ '_MANDATORYFILTER,'+ 'P' + pListPage+ '_MANDATORYFILTERVALUE,P' + pListPage+ '_REFERENCEDBY' + ':' + $v(P&APP_PAGE_ID._CALLTYPE) + ',' + $v(P&APP_PAGE_ID._CALLFROM) + ',' + $v(P&APP_PAGE_ID._SELECTEDRECORD) + ',' + $v(P&APP_PAGE_ID._MANDATORYFILTER) + ',' + $v(P&APP_PAGE_ID._MANDATORYFILTERVALUE) + ',' + $v(P&APP_PAGE_ID._REFERENCEDBY);
    top.location.href = lvurl;
    function deleteRecord(pListPage){
    document.getElementById("P&APP_PAGE_ID._CALLACTIONTYPE").value = 'DELETE';
    confirmDelete(htmldb_delete_message,'DELETE');
    But the problems what I couldnt sort out are;
    1- If any error happens in doSubmit(); (can be any DB error by triggers etc.) I cannot show the error. Does anybody know to check whether doSubmit() returned an error or not...
    2- Delete button shows the confirmation dialog box but when I confirm to delete I got an error show below;
    "     Checksum error for Hidden and Protected item ID (1737324593811176), value (DELETE), posted checksum (D636C53A8C84A57A1BBB04A61B600C4A), expected checksum (********************************), index_i (9), index_j (5), index_m (7); "
    Can you please tell me how to sort this problems or can anybody know that there's another ways to do these things?
    I really need help guys...
    Thank you very much,
    Osman...

    Hi Varad,
    We need to have custom buttons for save etc because there are some parameters must be transferred between screens. Let me explain it like this;
    Normally when you enter the IR screen, we set a couple of hidden items' values. (such as P_CALLFROM, P_CALLTYPE, etc...)
    and then user goes into a record to edit or insert.
    When user saves the record by pressing standard Apex "Apply Changes" button, page will go back to IR page but we loose the parameter which we assigned before...
    That's why I need to have a custom save, delete etc buttons...
    So, if I need to create a custom process, Do I need to collect all the filed values from the page by myself?
    Thanks,
    Osman...

  • Javascript Confirm popup Yes, No button instead of OK and Cancel?

    Hi,
    I wrote javascript for confirm popup like below:
    var answer = confirm ("Are you sure you want to delete this item ?");
    It is showing OK Cancel button popup , but I want to display Yes No buttons on popup insted of OK Cancel buttons...
    Appreciate if anyone give proper solution.
    Thank you.
    Still I could not get proper solution.... Please any one help me solve this... need js solution not jquery..

    Hi Praveen
    There is not direct option in JavaScript to get Yes/No buttons in a Confirm dialog.
    But, we can create a customized dialog box with our own HTML tags, controls and scripts and show it as a confirmation dialog using
    window.showModalDialog() function
    Here is the sample HTML to demonstrate how to create a customized confirmation dialog.
    Dialog.HTML (This contains the UI for the confirmation dialog. Message, Yes No buttons etc)
    <!DOCTYPE>
    <html>
    <head>
    <title>Confirmation Message</title>
    <script language="javascript" type="text/javascript">
    window.onload = function()
    var messageDiv = document.getElementById('dlgMessage');
    if ( messageDiv != null && typeof(messageDiv) != "undefined" )
    messageDiv.innerHTML = window.dialogArguments;
    function confirmClick(args)
    window.returnValue = args;
    window.close();
    </script>
    </head>
    <body>
    <div id="dlgMessage">
    </div>
    <input type="button" value="Yes" id="btnYes" onclick="javascript:confirmClick('yes')"/>
    <input type="button" value="No" id="btnNo" onclick="javascript:confirmClick('no');"/>
    </body>
    </html>
    MainPage.HTML (From where the confirmation dialog will be shown. In your case, u can use the script in this html and customize it according to ur needs)
    <!DOCTYPE>
    <html>
    <head>
    <title>Main Page</title>
    <script language="javascript" type="text/javascript">
    function showConfirmDlg(message)
    var returnValue = window.showModalDialog("dialog.html",message,"dialogHeight:150px;dialogWidth:200px");
    if ( returnValue == 'yes' )
    alert('Yes button is clicked in the dialog');
    else
    alert('No button is clicked in the dialog');
    </script>
    </head>
    <body>
    <input id="btnConfirm" type="button" value="Confirm" onclick="javascript:showConfirmDlg('Do you want to continue?');" />
    </body>
    </html>
    Hope this helps.
    See this MSDN Link for more information on how to use and customize the showModalDialog() function
    http://msdn.microsoft.com/en-us/library/ie/ms536759(v=vs.85).aspx

  • How to Add A Javascript Confirm() on an Apex button for a form?

    Hi, how can I add a Javascript confirm() to a button in Apex for a form? Thanks.

    Hello:
    You could do the following
    1)In the 'Option URL Redirect' section of the Edit Button page set 'Target is a ' to 'URL'
    2)For URL Target enter javascript:{if (confirm('Your Question here')) doSubmit('<button name>');}Varad
    Edited by: varad acharya on Jul 15, 2009 3:47 PM

  • Delete button action and javascript

    Hi! In old JDeveloper 10g I can put to my delete button JavaScript to open confirm window on button click - if(confirm(\'You are about to delete the selected record.\' )) {return true;} else {return false;}"
    What can I do in JDeveloper 11g and how to implement this functionality?
    Best regards, Debuger!

    Timo! When I do like You said then I have error: javax.servlet.ServletException: java.lang.NullPointerException
    I created popup and droped ther my delete button from my form. Then in form I created button that shows popup! I removed delete button disabled property so I can press it. But when I run my app. and click on delete button in popup then the following error occours:
    javax.servlet.ServletException: java.lang.NullPointerException
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
         at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:90)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:90)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         ... 36 more
    Caused by: java.lang.NullPointerException
         at kokaugi.view.bean.ValueHolder.deleteButtonPases_action(ValueHolder.java:95)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
         ... 52 more

  • Unable to get CommandAgrument value for the Edit Button in Gridview Control, Mean while it works for the Delete Button

    I want to show Edit/Delete Button using Ajax's HoverMenuExtender Control , But I also want to show edited record using ModalPopup Extender Control of AjaxCotrolltoolkit , for this I have used below code
    <asp:GridView ID="GridMainCat" runat="server" Width="100%" AutoGenerateColumns="false" DataKeyNames="CATID" OnRowDataBound="GridMainCat_RowDataBound" OnRowCommand="GridMainCat_RowCommand" OnPageIndexChanging="GridMainCat_PageIndexChanging" OnSelectedIndexChanging="GridMainCat_SelectedIndexChanging" AllowPaging="true" PageSize="10">
    <Columns>
    <asp:TemplateField>
    <HeaderTemplate>
    <table width="100%" border="1" style="color: blue;">
    <tr>
    <td width="20%">Catg Id</td>
    <td width="20%">Catg Name</td>
    <td width="25%">Catg Desc</td>
    <td width="35%">Catg Image</td>
    <%-- <td width="20%">Created Date</td>--%>
    </tr>
    </table>
    </HeaderTemplate>
    <ItemTemplate>
    <asp:Panel ID="panel2" runat="server">
    <table width="100%">
    <tr>
    <td width="20%"><%#Eval("CATID") %></td>
    <td width="20%"><%#Eval("CATNAME") %></td>
    <td width="25%"><%#Eval("CATDESC") %></td>
    <td width="35%"><%#Eval("CATIMAGE") %></td>
    <%-- <td width="20%"><%#Eval("CREATEDADTE") %></td>--%>
    </tr>
    </table>
    </asp:Panel>
    <!-----Panel for displaying the edit and delete options in GridView------>
    <asp:Panel ID="panel1" CssClass="HoverMenu"
    runat="server" Height="50" Width="50"
    HorizontalAlign="Left">
    <div>
    <asp:LinkButton Style="padding: 4px;" ID="lnkDel"
    CommandName="Dlt" runat="server" CausesValidation="false" Text="Delete" CommandArgument='<%#Bind("CATID") %>' OnClientClick="javascript:return('Are you sure, do you want to delete Record??')">
    </asp:LinkButton><br />
    <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit" CausesValidation="false" CommandName="Edt" CommandArgument='<%#Bind("CATID") %>' style="padding: 4px;" ></asp:LinkButton>
    </div>
    </asp:Panel>
    <asp:HoverMenuExtender ID="HoverMenuExtender1" runat="server" TargetControlID="panel2" PopupControlID="panel1" PopupPosition="Left" HoverCssClass="Hover"></asp:HoverMenuExtender>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>
    To Show ModalPopup I have used following aspx Code:-
    <asp:Button ID="btnShowPopup" runat="server" Style="display: none" CausesValidation="false" />
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnShowPopup" PopupControlID="PanelEditMainCategory" CancelControlID="btnUpdate" BackgroundCssClass="modalBackground"></asp:ModalPopupExtender>
    <asp:Panel ID="PanelEditMainCategory" runat="server" CssClass="modalPopup" Style="display: none;">
    <table style="border-width: 3px; border-color: lightseagreen;" border="1" align="center" height="300px">
    <tr>
    <th>
    <table>
    <tr>
    <th align="left">Category Id:</th>
    </tr>
    <tr>
    <th align="left">Category Name:</th>
    </tr>
    <tr>
    <th align="left">Category Description:</th>
    </tr>
    <tr>
    <th align="left">Category Image:</th>
    </tr>
    </table>
    </th>
    <td>
    <table>
    <tr>
    <td align="left">
    <asp:TextBox ID="txtCatID" Text='<%#Eval("CATID") %>' runat="server" Enabled="false"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td align="left">
    <asp:TextBox ID="txtCatName" Text='<%#Eval("CATNAME") %>' runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td align="left">
    <asp:TextBox ID="txtCatDesc" runat="server" Text='<%#Eval("CATDESC") %>' TextMode="MultiLine"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td align="left">
    <asp:TextBox ID="txtCatImage" runat="server" Text='<%#Eval("CATIMAGE") %>'></asp:TextBox>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <th align="left" colspan="2">
    <asp:Button ID="btnUpdate" Text="Update" CausesValidation="false" runat="server" OnClick="btnUpdate_Click" />&nbsp;
    <asp:Button ID="btnCancel" Text="Cancel" CausesValidation="false" runat="server" OnClick="btnCancel_Click" />
    </th>
    </tr>
    <tr>
    <th align="left"></th>
    <td align="left"></td>
    </tr>
    </table>
    </asp:Panel>
    Here is my .CS code :-
    protected void GridMainCat_RowCommand(object sender, GridViewCommandEventArgs e)
    catID = e.CommandArgument.ToString();
    if (e.CommandName == "Edt" && e.CommandArgument != null)
    ModalPopupExtender1.Show();
    Bind_Edit_MainCategory(catID);
    if (e.CommandName == "Dlt")
    Bind_Delete_MainCategory(catID);
    private void Bind_Grid_MainCategory()
    using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString))
    using (SqlCommand cmd = new SqlCommand("USP_FETCH_MAINCATEGORY", cn))
    try
    cmd.CommandType = CommandType.StoredProcedure;
    dt = new DataTable();
    da = new SqlDataAdapter(cmd);
    da.Fill(dt);
    GridMainCat.DataSource = dt;
    GridMainCat.DataBind();
    catch (Exception ex)
    throw ex;
    private void Bind_Delete_MainCategory(string catId)
    using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString))
    using (SqlCommand cmd = new SqlCommand("USP_DELETE_MAINCATEGORY", cn))
    try
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddWithValue("@CATID", catId);
    cn.Open();
    cmd.ExecuteNonQuery();
    Bind_Grid_MainCategory();
    catch (Exception ex)
    throw ex;
    private void Bind_Edit_MainCategory(string catid)
    using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString))
    using (SqlCommand cmd = new SqlCommand("USP_EDIT_MAINCATEGORY", cn))
    try
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddWithValue("@CATID", catid);
    cn.Open();
    SqlDataReader dr = cmd.ExecuteReader();
    if (dr.Read())
    txtCatID.Text = dr["CATID"].ToString();
    txtCatName.Text = dr["CATNAME"].ToString();
    txtCatDesc.Text = dr["CATDESC"].ToString();
    txtCatImage.Text = dr["CATIMAGE"].ToString();
    //modalPopupExtender1.Show();
    ModalPopupExtender1.Show();
    Bind_Grid_MainCategory();
    catch (Exception ex)
    throw ex;
    it works fine for HoverMenu Extender, and for the delete button as well. When I click on Delete Button It finds CommandArgument value But as I click on Edit Button It does not find CommandArguement value. Kindly help me to fix this problem

    Do you mean it's firing when you click Edit?. I've replicated your code as below and it worked, try to remove the OnRowCommand run a build and then add the it again:
    protected void Page_Load(object sender, EventArgs e)
    BindGridwithDummy();
    protected void GridMainCat_RowCommand(object sender, GridViewCommandEventArgs e)
    string catID = e.CommandArgument.ToString();
    if (e.CommandName == "Edt" && e.CommandArgument != null)
    if (e.CommandName == "Dlt")
    private void BindGridwithDummy()
    DataTable dt = new DataTable();
    DataRow dr;
    dt.Columns.Add(new System.Data.DataColumn("Test", typeof(String)));
    dr = dt.NewRow();
    dr[0] = "A dummy Data"; //Adds the Dummy Data in the Row
    dt.Rows.Add(dr);
    // Show the DataTable values in the GridView
    GridView1.DataSource = dt;
    GridView1.DataBind();
    <asp:GridView ID="GridView1" runat="server" OnRowCommand="GridMainCat_RowCommand">
    <Columns>
    <asp:BoundField DataField="Test" />
    <asp:TemplateField>
    <HeaderTemplate>
    Button</HeaderTemplate>
    <ItemTemplate>
    <asp:LinkButton Style="padding: 4px;" ID="lnkDel" CommandName="Dlt" runat="server"
    CausesValidation="false" Text="Delete" CommandArgument="1" OnClientClick="javascript:return('Are you sure, do you want to delete Record??')"></asp:LinkButton><br />
    <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit" CausesValidation="false"
    CommandName="Edt" CommandArgument="2" Style="padding: 4px;"></asp:LinkButton>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>

  • Delete buttons in report region & javascript

    I managed to add a delete button on each line of my report region using 'Column link' with
    text <img src="#IMAGE_PREFIX#delete.gif" border="0" alt="Verwijderen Icon">
    url f?p=&APP_ID.:504:#APP_SESSION#:TEST:::P504_DELETE_ID_LCNT:#ID#
    and some extra coding.
    problem is : i'd like to add a javascript:confirmDelete function
    In a 'Normal' button you can add it via URL Target.
    Can anyone help me ?

    This seems to be the way to add javascript to the url-code
    f?p=&APP_ID.:504:#APP_SESSION#:TEST:::P504_DELETE_ID_LCNT:#ID#" onClick="javascript:confirmDelete('Are you sure....')
    The only problem now is to add some kind of code to javascript to cancel further processing??????
    return true or false has no effect.
    I tried to set the REQUEST-value but i can't find the solution.
    Please help.

  • Delete  'button' on report how to do this?

    Hi,
    I have a requirement to implement a 'delete' button on a report, but cannot find out how to do it. I found the following site which does exactly what I want, but cannot get to the code to see how the author has done it can any one assist please?
    http://apex.oracle.com/pls/otn/f?p=40323:32:689305137368050
    Thanks inadvance.

    Hello:
    Let's assume your report query is something similar to
    select empno,ename from emp
    You do the following
    In the Column Attributes for report set the column-link for the 'empno' column to redirect to a URL
    Set the URL to be
    javascript:doDelete(#EMPNO#);
    Create a button named 'DELETE'. Set the button to submit the page and branch back to the same page. Set the button's condition to 'Never'
    Create a page-item named 'P1_EMPNO' of type hidden
    Create a 'On Submit' pl/sql page process that is conditional on the 'DELETE' button with the following code
      delete from emp where empno=:p1_empno;Add the following javascript in the HTML header <script>
    function doDelete(empno) {
       if (confirm('Delete employee ' || empno)) {
          $s('P1_EMPNO',empno)
         doSubmit('DELETE')
    </script>varad

  • Delete Button in Forms

    Hi All,
    If you want to add a confirmation message to the delete button in a form, just add the following code to the Javascript OnClick event of the button:
    return confirm('Are You Sure You Wish To Delete This Record?');
    I hope this would help somebody

    Hi Francois,
    I will check detail in Help for Form Success and Failure, Thanks for reply.
    Khawar

  • Broken Delete button in Dynamic Form. For the ADDT gurus!

    I have a feeling i may be at Günter's mercy on this one. Hope you have time to look at this; of course for any and all, the same applies!
    I have a dynamic list which i spent quite a lot of time with - rearranging elements within the ADDT generated KT_tng table. Just moving one recordset piece can take up to 30 seconds, so it takes QUITE a while with a lot of data to move.
    Anyways, i seem to have "broken" the delete button in mine. I hope someone can help me fix it, i really dont have time to redo all the changes i did to the dynamic list layout. (i did test as i went to make sure i didnt break it, but guess i just missed a piece..) I changed mainly the location of things, and CSS.
    I have an older version where the delete button works. I have compared but cannot find the answer. Both versions do everything else, live, with the database & their respective dynamic forms.
    I have all 4 files live, and unprotected, for now, and txt versions of all four. If you need to test anything with the live pages, its ok, most of the data is dummy data.
    Ive been saturated in ADDT dynamic lists, and dont have a background of hand coder, but am learning a lot, quick. so i have tried hard to understand this exact issue i created - im not looking for others to do my work. just my little disclaimer :)
    /* TEXT VERSIONS */
    /*Broken delete button*/
    http://www.aquatictrainingservice.com/admin/courses_list.txt
    http://www.aquatictrainingservice.com/admin/courses_form.txt
    /*Working delete button */
    http://www.aquatictrainingservice.com/admin/courses_list2_.txt
    http://www.aquatictrainingservice.com/admin/courses_list2_detailsl.txt
    /*LIVE PHP VERSIONS*/
    /*broken delete button*/
    http://www.aquatictrainingservice.com/admin/courses_list.php
    http://www.aquatictrainingservice.com/admin/courses_form.php
    /*working delete button*/
    http://www.aquatictrainingservice.com/admin/courses_list2_.php
    http://www.aquatictrainingservice.com/admin/courses_list2_detailsl.php
    best
    ben

    Include the following javascript code under the onClick event of the delete button.
    It works for me.
    onClick:
    var x=window.confirm('Are you sure ?')
    if (x)
    do_event(this.form,this.name,1,'ON_CLICK','');
    else
    return false

  • Delete button added later.

    I have created a number of page pairs in my application using the "form on a table with report" method. Initially I asked for insert and update buttons but no delete buttons because I wanted to protect our test data. I now need to add the delete buttons. Sometimes they work and sometimes they do not. I have compared everything I can - please help me. Trudy.
    My delete button definition is as follows:
    Sequence = 20
    Button Name = DELETE
    Label = Delete
    Region is correct
    Button Position = Region Template Position #DELETE#
    Button Style = Template Based Button
    Button Template = Button
    Database Action = SQL DELETE action
    Condition Type = Value of Item in Expression 1 Is NOT NULL (or != Zero)
    Expression 1 = Pnn_NAME_ID where nn is the same page number
    Target = URL
    URL Target = javascript:confirmDelete(htmldb_delete_message,'DELETE');
    The delete buttons that work do not have an associated branch.

    *** MORE SPECIFIC PROBLEM DEFINITION
    The Delete button works when I change my definition as follows:
    Target = '- No Target -'
    URL Target = unavailable
    *** Please explain how I can to do the confirm delete popup.
    My delete button definition was as follows and it works OK for some other tables:
    Sequence = 20
    Button Name = DELETE
    Label = Delete
    Region is correct
    Button Position = Region Template Position #DELETE#
    Button Style = Template Based Button
    Button Template = Button
    Database Action = SQL DELETE action
    Condition Type = Value of Item in Expression 1 Is NOT NULL (or != Zero)
    Expression 1 = Pnn_NAME_ID where nn is the same page number
    Target = URL
    URL Target = javascript:confirmDelete(htmldb_delete_message,'DELETE');

  • Two reports's entries to the same form, the DELETE button works unproperly.

    I have two reports refrencing one form in which I have one item whose value is set by the refrencing report. In the form I build two branches back to the two resports by the item's value(conditional branch). when press the SAVE or CREATE button all work properly. But when press DELETE button, it seems the system clears all caches so that the item loses value. Then my two branches don't work. If I change "Javascript:apex.confirm..." to "Javascript:confirmDelete('...');" ,the two branches work, but the validations are always working, even if I change then validation option to "No". Can anyone help me? Thanks.

    I have found the answer.

  • Delete button on Form based on a table

    I created a form based on a table. For the delete button, how can I make it ask before deleting the record? ie, when the user hits Delete, a question comes up that asks: Do you really want to delete this record? The user then hits Yes or No.
    Please be specific, I'm new to Portal. Thanks for any help.

    1. Edit your Form and go to "Step 4 of 7, Formatting and Validation Options" section of the builder.
    2. In the left frame, click on DELETE_TOP and/or DELETE_BOTTOM link.
    3. In the right frame, you should see a section (i.e. "Javascript Event Handlers") where you can add your own javascript code. Click on the onClick event.
    4. In the adjacent free-text field, add the following code:
    javascript:if(confirm('Do you really want to delete this record?')){
    null;
    else
    window.stop();
    5. Click on OK to compile. That's it.
    The window.stop() is needed to prevent the PL/SQL event handler (i.e. Update) from running. Without window.stop(), if the user presses Cancel, the form will perform an update anyway. You'll need to remember that the Form will by default perform the Javascript handlers first, then the PL/SQL handler.

Maybe you are looking for

  • I need to reset my security questions but when I send an email to the rescue email it doesn't get to me its the wrong email. help?

    iTunes wont let me download any music and I have over $20 on my account. It says I need to answer my security questions but I don't know the answers. When I try to send an email to the rescue email, it doesn't work. It says the email starts with an "

  • Warning while running pre-req checks for installing 11g binaries

    I am trying to install 11g binaries on my box for upgrading my production db from 10.2.0.4 to 11.1.0.7. I have dev and Prod running from the same box. I already upgraded my dev instance to 11g and its home is /opt/oracle/product/11.10/dev. I created

  • Progressive downconvert for editing

    I have an animation that's going out to a Final Cut Pro timeline. The sequence in FCP is DVCPro50 Standard def. The animation I created is HD 1920 x 1080 square pixels, because the project may have to be upconverted in the future. What would be the b

  • Blurry Tiff images

    Hi, As a new Motion user I'm having some issues with my first project. I've used After Effects since version 2-3 so I know my way around similar apps. I've imported an uncompressed movie from FCP5.0.4 and I need to overlay a series of 6 images starti

  • Iphone 5 crazy data usage

    I just purchased the iPhone 5 for my daughter.  Apparently, the iPhone 5 doesn't recognize wifi unless you go into settings and turn something off.  Att sent codes to the phone and gave a 25.00 credit.  They tried to say we didn't purchase a larger d