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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:25:19+00:00 2026-06-04T21:25:19+00:00

I have a check box group in my page. After checking the inputs, if

  • 0

I have a check box group in my page. After checking the inputs, if they are wrong, an error message will be shown to the user, but the status of check boxes are lost. This is part of my code that shows a group checkbox with three items (CONFIGURATION, TESTER, DEVELOPER):

    group = new CheckGroup("group", user.getRoleNames());
    group.add(new CheckGroupSelector("groupselector"));

    // The list of possible roles
    List<String> roleNames = new ArrayList<String>();
    roleNames.add(Roles.CONFIGURATION.value());
    roleNames.add(Roles.TESTER.value());
    roleNames.add(Roles.DEVELOPER.value());

    group.add(new ListView("roles", roleNames) {
        protected void populateItem(ListItem item) {
            item.add(new Check("checkbox", item.getModel()));
            item.add(new Label("name", item.getModel()));
        }
    });
    add(group);

Also I have two text boxes of username and password. If user enters a wrong password, she/he will get an error message, but after showing the error message, the checked items become unchecked, Do you know how I can keep the status of check boxes?

  • 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-04T21:25:21+00:00Added an answer on June 4, 2026 at 9:25 pm

    I changed my code as the following:

           ListView roles = new ListView("roles", roleNames) {
                protected void populateItem(ListItem item) {
                    item.add(new Check("checkbox", item.getModel()));
                    item.add(new Label("name", item.getModel()));
                }
            };
            roles.setReuseItems(true);
            group.add(roles);
    

    and now it works correctly. So, the only required thing is setting setReuseItems to true.

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

Sidebar

Related Questions

I have a check box that will if checked send a gift as a
Hi All I have a group of check box having same name so as
INSERT MODE i have check box in one tr. and another dropdown control in
I have a check box, which when it is checked, fires a call to
I have a check box, RequiredFieldValidator and textbox that have editmask extender I want
I have a check box and I have subscribed for the CheckedChanged event. The
I have update panel that content check box, textbox, 3 DropDownList with CascadingDropDown extender.
I have this code that I want to a) run when the check box
I have a listview whose rows has one textview and a check box. I
I have a table where each rows has a check box. This code works

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.