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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:24:04+00:00 2026-05-20T08:24:04+00:00

Problem: user made some selection in the multi-selection listbox, then pressed a checkbox, and

  • 0

Problem: user made some selection in the multi-selection listbox, then pressed a checkbox, and selection got lost. I need the selection to be preserved.

I have a report wizard which extends (wicket.extensions.wizard.Wizard)
I have a step which extends WizardStep.WizardStep
On this step I have a mutli-selection box which extends wicket.markup.html.form.ListMultipleChoice
I add it as follows:


final ChooseListMultipleChoice allPlansChoiceField = new ChooseListMultipleChoice(PLANS_SELECT_ALL_PLANS_LIST, new PropertyModel(this, "selectedAllPlans"), allPlans);
allPlansChoiceField.setOutputMarkupId(true);
add(allPlansChoiceField);

and I also have AjaxCheckBox (wicket.ajax.markup.html.form.AjaxCheckBox)
Used like this:


  AjaxCheckBox displayArchived = new AjaxCheckBox(DISPLAY_ARCHIVED){
            protected void onUpdate(final AjaxRequestTarget target) {
                allPlans.clear();
                final boolean isDisplayArchived = rawReportFilterInput.isDisplayArchived();
                List listAllPlan = projectFacade.listActiveAndClosingPlans(isSort, isDisplayArchived);
                allPlans.addAll(listAllPlan);
                target.addComponent(allPlansChoiceField);
            }
        };
        add(displayArchived);

inside the onUpdate method the model “selectedAllPlans” is not updated with current user selection. For instance, if I had just a simple ajax submit buttom, then it would have triggered the onSubmit event and all form data would have been passed and “selectedAllPlans” would be populated with user selection.
I need the exact same behaviour when user checks/unchecks the AjaxCheckBox. So far, I haven’t been able to make it working, model is always size = 0.

MarkUp:

<div class="effortsReport" style="height: 220px;">
<table>
    <tr>
        <input type="checkbox" wicket:id="plansSelect.displayArchived">
        <br><div class="fixed_select"><select wicket:id="allPlansList"/></div></td>
    </tr>
</table>
</div>

I would appreciate some advise, possible solutions.
Best regards,
Oleg

  • 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-20T08:24:04+00:00Added an answer on May 20, 2026 at 8:24 am

    Okay I figured it out, just do this:

    allPlansChoiceField.add(new AjaxFormComponentUpdatingBehavior("onchange") {
            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                target.addComponent(allPlansChoiceField);
            }
        });
    

    and that’s all. You do not even need to store/restore the state, it just works. Yes it took time to find this out, but it’s possible and easy in the end. Gotta love Wicket.

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

Sidebar

Related Questions

I have a bit of a problem with user controls. Basically what I want
My problem is that I have a user that is having a problem displaying
I have a problem regarding getting the path of a user control. The scenario
I have a quite common problem, as I saw in the various user groups
I've got a strange problem and really don't understand what's going on. I made
I have my little client application which - when started - creates some user
I am just learning the Entity Framework and have made some good progress on
EDIT: I believe i may have found the problem. I need to work on
I have made one custom user control (search text box), which basically consists of
I am trying to debug a problem where a user clicks on the button

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.