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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:43:15+00:00 2026-05-31T23:43:15+00:00

I am working on wicket. I used a checkbox for every row in a

  • 0

I am working on wicket. I used a checkbox for every row in a table which is generated through Listview. I want to delete a particular row by using checkbox selection.

This table can be generated by using Listview which shows table data. Please tell me at least how I would get the row id by selection of multiple checkboxes. Please tell me how could I do this?

package com.cerebrum.pages;

import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.form.CheckGroup;
import org.apache.wicket.markup.html.form.CheckGroupSelector;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.PropertyModel;

import com.cerebrum.common.Home;
import com.cerebrum.hibernate.Users;
import com.cerebrum.hibernate.UsersHome;
import com.cerebrum.pojo.AdminViewUserModel;

public class AdminViewUser extends Home
{
    UsersHome usersHome=new UsersHome();
    List<AdminViewUserModel> listCal = new ArrayList<AdminViewUserModel>();
    AdminViewUserModel adminViewUserModel=new AdminViewUserModel(); 

    public AdminViewUser()
    {
        super();
        add(new AdminViewUserForm());
    }

    public class AdminViewUserForm extends Form
    {
        public AdminViewUserForm()
        {
            super("AdminViewUserForm");
            setModel(new CompoundPropertyModel(adminViewUserModel));

            List<Users> lstUsers=usersHome.getUserInfo();
            for(Users users:lstUsers)
            {
                listCal.add(new AdminViewUserModel(users.getFirstName(),
                    users.getMiddleName(),users.getLastName(),users.getDateOfBirth(),
                    users.getEmailId(),users.getMobileNo(),users.getUserName(),
                    users.getPassword()));
            }

            ListView listViewCal = new ListView("listViewCal", listCal) 
            {
                protected void populateItem(ListItem item) 
                {
                    AdminViewUserModel model=(AdminViewUserModel)item.getDefaultModelObject();
                    CheckBox chkBoxSelect=new CheckBox("chkBoxSelect",new PropertyModel(model, "chkBoxSelect"));
                    item.add(chkBoxSelect);

                    TextField txtFname=new TextField("txtFname",new PropertyModel(model, "txtFname"));
                    item.add(txtFname);

                    TextField txtMname=new TextField("txtMname",new PropertyModel(model, "txtMname"));
                    item.add(txtMname);
                    TextField txtLname=new TextField("txtLname",new PropertyModel(model, "txtLname"));
                    item.add(txtLname);
                    TextField txtDOB=new TextField("txtDOB",new PropertyModel(model, "txtDOB"));
                    item.add(txtDOB);
                    TextField txtEmail=new TextField("txtEmail",new PropertyModel(model, "txtEmail"));
                    item.add(txtEmail);
                    TextField txtMobileNo=new TextField("txtMobileNo",new PropertyModel(model, "txtMobileNo"));
                    item.add(txtMobileNo);

                    TextField txtUserName=new TextField("txtUserName",new PropertyModel(model, "txtUserName"));
                    item.add(txtUserName);
                    TextField txtPassword=new TextField("txtPassword",new PropertyModel(model, "txtPassword"));
                    item.add(txtPassword);
                }
            };
            listViewCal.setOutputMarkupId(true);
            add(listViewCal);

            AjaxButton btnUpdate=new AjaxButton("btnUpdate")
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> arg1)
                {
                }
            };
            btnUpdate.setOutputMarkupId(true);
            add(btnUpdate);

            AjaxButton btnDelete=new AjaxButton("btnDelete")
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> arg1) 
                {
                }
            };
            add(btnDelete);
        }
    }
}
  • 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-05-31T23:43:17+00:00Added an answer on May 31, 2026 at 11:43 pm

    Have a look at this: https://cwiki.apache.org/WICKET/listview-with-checkboxes.html

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

Sidebar

Related Questions

I am currently working on a web app using Wicket and started using jQuery
I'm working on an embedded Jetty + Wicket app and I'm using buildr. Right
Working on a Wicket application that adds markup to the DOM after onLoad via
I'm working on an Apache Wicket project in Eclipse with Maven2 -- my SCM
is there any working, supported and maintained scaffolding solution for Wicket 1.5? I know
I'm using the wicked Gallerriffic plugin on a gallery page, and got it working
Working through trace tables and wanted to check to see if my results where
I'm working on porting part of an existing Spring MVC application over to Wicket.
I'm working on a web application with Wicket, Spring and Hibernate and I've come
I have a Java EE 6 Wicket application deployed with maven using IntelliJ IDEA

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.