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

  • Home
  • SEARCH
  • 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 8683967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:10:36+00:00 2026-06-12T22:10:36+00:00

I am developing a small application in struts 2 with Jquery Grid for displaying

  • 0

I am developing a small application in struts 2 with Jquery Grid for displaying data results.

When i click edit button then the specific row id is coming.
But when i click the delete button for deleting that row ,then its id is not coming.
How to get the id of row when delete action is performed with the selected row(Struts2 Jquery Grid)?

Plz help me for this.

myJspFile.jsp

            <%@ page contentType="text/html; charset=UTF-8"%>
            <%@ taglib prefix="s" uri="/struts-tags"%>
            <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

            <%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
            <jsp:include page="../../loginCheck.jsp" />
            <html>
            <head>
            <title>Hello World</title> 
            <style type="text/css">
            @import
            url(<%=request.getContextPath()%>/css/style1.css);
            </style> 
             <sj:head jqueryui="true" jquerytheme="le-frog"/>
            </head>
            <body> 
                <div id="setpage"> <s:url id="editurl" action="nedit"/>
                    <s:url id="editurl" action="nedit"/>
                    <s:url  id="remoteurl" action="ntable"/> 
                  <sjg:grid
                    id="gridtable"
                    caption="Subject Setup Navigator"
                    dataType="json"
                    href="%{remoteurl}"
                    pager="true"
                    rowList="10,20,100"
                     rowNum="5"
                    navigator="true"
                    width="999"
                    navigatorSearchOptions="{sopt:['eq','ne','lt','gt']}"
                    navigatorAddOptions="{height:280,reloadAfterSubmit:true}"
                    navigatorEditOptions="{height:280,reloadAfterSubmit:false}"
                    navigatorEdit="false"
                    navigatorView="false"
                    navigatorDelete="true"
                    navigatorDeleteOptions="{height:280,reloadAfterSubmit:true}"
                    gridModel="gridModel" 
                    editurl="%{editurl}"
                    editinline="true"
                    onSelectRowTopics="rowselect"

                >
                       <sjg:gridColumn name="subjectId" index="subjectId" title="SubjectId" formatter="integer" sortable="false" key="true"    hidden="true"   />
                       <sjg:gridColumn name="subjectName" index="subjectName" title="Subject Name" sortable="true" search="true"
                                        editable="true"
                                        edittype="text" />
                    </sjg:grid> 
                <br/>

                </div>
            </body>
            </html>

MyActionClass.java

                /*
             * To change this template, choose Tools | Templates
             * and open the template in the editor.
             */
            package v.esoft.actions.subjectdetails; 
            import com.opensymphony.xwork2.ActionSupport; 
            import java.text.SimpleDateFormat; 
            import com.opensymphony.xwork2.ModelDriven; 
            import v.esoft.dao.SubjectdetailsDAO.SubjectdetailsDAO; 
            import v.esoft.pojos.Subjectdetails;

            public class SubjectdetailsEditAction   extends ActionSupport  implements ModelDriven<Subjectdetails>
            {
                private static final long serialVersionUID = -6659925652584240539L; 
               private String oper; 
                int subjectId;
                 Subjectdetails subject=new Subjectdetails();
               SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd"); 
               SubjectdetailsDAO dao=new SubjectdetailsDAO();       


               @Override
               public Subjectdetails getModel()
            {   
                  return subject;
               }

              public String execute() throws Exception
                {    
                  System.out.println(subject.getSubjectId());
                  if(oper.equalsIgnoreCase("add"))
                    {
                      System.out.println ("inside action");
                      dao.saveOrUpdateSubject(subject);  
                    }
                    else if (oper.equalsIgnoreCase("edit"))
                    { 
                         dao.saveOrUpdateSubject(subject);  
                    }
                    else if (oper.equalsIgnoreCase("del"))
                    {
                        System.out.println("subjectId");
                        System.out.println(subject.getSubjectId());
                    //  dao.deleteSubject(subjectId);
                    }
                    return SUCCESS;
                } 
              //---------------
                public String getOper() {
                    return oper;
                }

                public void setOper(String oper) {
                    this.oper = oper;
                }


                public Subjectdetails getSubject() {
                    return subject;
                }


                public void setSubject(Subjectdetails subject) {
                    this.subject = subject;
                }
                public int getSubjectId() {
                    return subjectId;
                }
                public void setSubjectId(int subjectId) {
                    this.subjectId = subjectId;
                }


            }

Subjectdetails.java [My pojo]

                package v.esoft.pojos;

            // Generated Oct 6, 2012 1:58:21 PM by Hibernate Tools 3.4.0.CR1

            import java.util.Date;

            /**
             * Subjectdetails generated by hbm2java
             */
            public class Subjectdetails implements java.io.Serializable {

                private int subjectId;
                private String subjectName;
                private Integer createrId;
                private Date createdDate;
                private Integer updateId;
                private Date updatedDate;

                public Subjectdetails() {
                }

                public Subjectdetails(int subjectId) {
                    this.subjectId = subjectId;
                }


                public Subjectdetails(int subjectId, String subjectName, Integer createrId,
                        Date createdDate, Integer updateId, Date updatedDate) {
                    this.subjectId = subjectId;
                    this.subjectName = subjectName;
                    this.createrId = createrId;
                    this.createdDate = createdDate;
                    this.updateId = updateId;
                    this.updatedDate = updatedDate;
                } 

                public int getSubjectId() {
                    return this.subjectId;
                }

                public void setSubjectId(int subjectId) {
                    this.subjectId = subjectId;
                }

                public String getSubjectName() {
                    return this.subjectName;
                }

                public void setSubjectName(String subjectName) {
                    this.subjectName = subjectName;
                }

                public Integer getCreaterId() {
                    return this.createrId;
                }

                public void setCreaterId(Integer createrId) {
                    this.createrId = createrId;
                }

                public Date getCreatedDate() {
                    return this.createdDate;
                }

                public void setCreatedDate(Date createdDate) {
                    this.createdDate = createdDate;
                }

                public Integer getUpdateId() {
                    return this.updateId;
                }

                public void setUpdateId(Integer updateId) {
                    this.updateId = updateId;
                }

                public Date getUpdatedDate() {
                    return this.updatedDate;
                }

                public void setUpdatedDate(Date updatedDate) {
                    this.updatedDate = updatedDate;
                }

            }
  • 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-12T22:10:37+00:00Added an answer on June 12, 2026 at 10:10 pm

    Use id instead of subjectId as primary key.
    And once again create your sql table and pojo. Then it will work.

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

Sidebar

Related Questions

I am developing a small application in struts 2 with Jquery Grid for displaying
I am developing small application for training purposes. There after click on the button
I'm developing a small application that reads data from a database and displys it
I'm developing a small application which requires adding user-defined values to a grid. Problem
I am developing a small web application that uses jquery's drag and drop. Problem
I'm developing a small application that has a few button and labels. On my
I am developing a small application using Struts, Spring and hibernate3. But now I
im developing a small application with login and having an issue accessing session data.
I am developing a small application and for that authentication is needed. That I'm
I'm developing a small application using Blend, basically what I have in my application

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.