Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9103973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:45:16+00:00 2026-06-17T01:45:16+00:00

I developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10). I

  • 0

I developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).

I am using JQGRID to display data in tabular format. I also want functionality of Add, Edit, Delete in JQGRID. So far I have completed Edit Functionality.

Now I want Delete functionality, the problem is that I am not able to pass data from JQGRID to servlet.

Following is my source code:

jQuery("#list10_d2").jqGrid({
                height: "100%",
                url:'ProtocolJGridServChildStages?q=2&action=protStages',
                datatype: "xml",
                 colNames:['Sr. No.','PROTOCOL_ID',  'STAGE_ID',  'DESCRIPTION'],
                 colModel:[{name:'srNo',index:'srNo', width:35,sortable:true},
                           {name:'PROTOCOL_ID',index:'PROTOCOL_ID', width:100,sortable:false},
                           {name:'STAGE_ID',index:'STAGE_ID', width:100,sortable:false},
                           {name:'DESCRIPTION',index:'DESCRIPTION', width:150,sortable:false,editable:true}
                           ],
                rowNum:5,
                rowList:[2,4,10],
                pager: '#pager10_d2',
                sortname: 'PROTOCOL_ID',
                viewrecords: true,
                sortorder: "asc",
                multiselect: true,
                editurl: "ProtocolJGridServChildStages?action=protocolStageEdit",
                caption:"CRM_PROT_STAGES",
                onSelectRow: function(ids)
                {
                    if(ids && ids!==lastsel)
                    {               
                        var ret = jQuery("#list10_d2").jqGrid('getRowData',ids);
                        protID = ret.PROTOCOL_ID;
                        alert(protID);
                        stageID = ret.STAGE_ID;
                        alert(stageID);

                        jQuery("#list10_d2").jqGrid('setGridParam',{}, {editurl:'ProtocolJGridServChildStages?action=protocolStageEdit&protID='+protID+'&stageID='+stageID});
                        jQuery('#list10_d2').jqGrid('restoreRow',lastsel);
                        jQuery('#list10_d2').jqGrid('editRow',ids,true);
                        lastsel=ids;
                    }
                }
            });
            jQuery("#list10_d2").jqGrid('navGrid','#pager10_d2',{add:true,edit:true,del:true},{width:500},{width:500,url: 'ProtocolJGridServChildStages?action=protocolStageAdd&protID='+protID, closeAfterAdd: true},{mtype: 'GET',url: 'ProtocolJGridServChildStages?action=protocolStageDelete&protID='+protID});
            jQuery("#ms1").click( function() {
                var s;
                s = jQuery("#list10_d2").jqGrid('getGridParam','selarrrow');
                alert(s);
            });

I am getting protID value undefined in my DeleteServlet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:45:17+00:00Added an answer on June 17, 2026 at 1:45 am

    You use protID in the url in the wrong way. The value of url option used for Delete operation will be set once during executing of the call of navGrid. At the moment you not yet set any value for the variable protID. You can fix the code you can use one from the following ways: onclickSubmit, delData, beforeSubmit or serializeDelData.

    I am wounder a little that you use mtype: 'GET' option for delete operation. Typically one use HTTP POST or HTTP DELETE in the case. If you really need mtype: 'GET' you can replace

    {
        mtype: 'GET',
        url: 'ProtocolJGridServChildStages?action=protocolStageDelete&protID=' + protID
    }
    

    parameter of navGrid to

    {
        mtype: 'GET',
        url: 'ProtocolJGridServChildStages',
        delData: {
            action: 'protocolStageDelete',
            protID: function () {
                return protID;
            }
        }
    }
    

    or alternatively

    {
        mtype: 'GET',
        url: 'ProtocolJGridServChildStages',
        onclickSubmit: function (options, rowid) {
            var rowData = jQuery(this).jqGrid('getRowData', rowid);
            return {
                action: 'protocolStageDelete',
                protID: ret.PROTOCOL_ID
            };
        }
    }
    

    If you do consider to use mtype other as GET, but will need to set protID as part of URL you can modify url option dynamically inside of onclickSubmit or beforeSubmit callback. For example

    {
        mtype: 'GET',
        onclickSubmit: function (options, rowid) {
            var rowData = jQuery(this).jqGrid('getRowData', rowid);
            options.url = 'ProtocolJGridServChildStages?' + jQuery.param({
                action: 'protocolStageDelete',
                protID: ret.PROTOCOL_ID
            });
        }
    }
    

    You can choose yourself the way which better corresponds your requirements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10).
I am developing a web application using JSP & Servlet.(IDE: Eclipse, Container: Tomcat7.0) To
I am developing web application using JSP and Servlet (IDE: Eclipse, Container: Tomcat7.0, DB:
I am developing a web application. I am using Eclipse as IDE. I was
I am using eclipse Indigo IDE ..I am developing a jsp application ( myProject
I am developing a web application using JSP and Servlet. I am trying to
I'm developing a simple servlet/JSP, data-driven web site on Google App Engine. I've started
I am using Spring Web MVC and Hibernate for developing my application. My login.jsp
I am developing a dynamic JSP/Servlet web application. In order to handle the session,
I am developing a web application using Java/JSP. One class, say Student, has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.