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 7756825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:55:18+00:00 2026-06-01T12:55:18+00:00

I have added checkbox in display table using decorator class as shown in below

  • 0

I have added checkbox in display table using decorator class
as shown in below snippet

public String getStatus()
       {
    DisplayLogTimeForm dltf =(DisplayLogTimeForm)getCurrentRowObject();
    String ret="";

    String status= dltf.getStatus();
    String date= dltf.getSET_DATE();
    //System.out.println("Decorator..." + date);
    if(status.equals("notpresent"))
    {

        System.out.println("Decorator..." + date);
        ret="<input type='checkbox' size='10' id = 'statusp"+i+"' name = 'statusp' property = 'status' value='"+date+"' onclick='changeCounter(this.id);' /><input type='hidden' name='checkedBox' value='"+i+"' />";
        i++;

        System.out.println("id.." + ret);
        System.out.println("id.." + i);
        return ret;
    }
    else
    {
        return null;
    }

I want to get the value of checkbox in action class.Please suggest

  • 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-01T12:55:19+00:00Added an answer on June 1, 2026 at 12:55 pm

    I also faced like that problem and that is currently used in my project.
    Hope that it is useful for you.

    Approve.jsp
    ============
    
    <%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
    <jsp:scriptlet>
    <![CDATA[  
    org.displaytag.decorator.CheckboxTableDecorator decorator = new org.displaytag.decorator.CheckboxTableDecorator();
    decorator.setId("form_no");  
    decorator.setFieldName("_chk");
    request.setAttribute("checkboxDecorator", decorator);        
    ]]>
    </jsp:scriptlet>
    
    <script type="text/javascript">
    function Fnc_FormAction(action)
    {   
    document.forms[0].action="<%=request.getContextPath()%>/approve.do?reqCode="+action;
    document.forms[0].submit();
    }
    function checkbox(form,form_no)
    {
    if(form.checked)
    {
    form.value= form_no;         
    }    
    }
    </script>
    <html:form method="POST" action="/approve.do" styleClass="FORM" styleId="form" style="form">    
    <display:table name="result" export="false" class="displaytag"
    requestURI="/approve.do?reqCode=approve" id="ReportTable"
    uid="ReportTable" cellpadding="0" style="width:1200px"
    decorator="checkboxDecorator" excludedParams="updateList">
    <display:column title="Check To Approve">
    <input name="form_no" type="hidden" value="<%=((Approval)ReportTable).getForm_no() %>" />
    <input type="checkbox" name="chk" value="<%=((Approval)ReportTable).getForm_no() %>" onclick="checkbox(this,<%=((Approval)ReportTable).getForm_no() %>)">
    </display:column>
    <input type="button" name="Approve" id="Approval" value="  Approve  " onclick="Fnc_FormAction('approveByRoles')"/>
    </display:table>
    
    
    ApproveActionForm
    ==================
    private int chk[];
    /**
    * @return the chk
    */
    public int[] getChk() {
    return chk;
    }
    /**
    * @param chk the chk to set
    */
    public void setChk(int[] chk) {
    this.chk = chk;
    }
    
    
    
    ApproveAction.java
    ==================
    
    public ActionForward approveByRoles(ActionMapping mapping, ActionForm form,
    HttpServletRequest  request,HttpServletResponse response) throws STException 
    {
    ApproveActionForm aprForm=(ApproveActionForm)form;
    if(aprForm.getChk()!=null)
    {  
    int chks[] = aprForm.getChk();
    int updateFormNo = 0;
    for(int i=0;i<chks.length;i++)
    {   
    updateFormNo = chks[i];
    System.out.println("Updated Form Number is = "+ updateFormNo);
    }   
    }
    }       
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added a class to all of the td's associated with my table.
I have a gridview that I have added a checkbox column using a templatefield
I have an area where a chunk of HTML (shown below) is added dynamically
I have added checkbox selection model to grid panel. It works fine in IE8
I have added some settings to my c# application using the configuration editor. There
I have added the COleDropTarget variable to my view class and registered it in
I have added a textbox, a dropdownlist, a checkbox, a button, and an update
I have a form which contains list of data, I added a checkbox in
i've added a checkbox to a checkedlistbox using the following code: CheckBox cb =
I am using Facebook registration plugin. And I added a checkbox field that I

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.