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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:44:00+00:00 2026-05-24T04:44:00+00:00

I have a question about the ListMultipleChoice, is there anyway to get the selected

  • 0

I have a question about the ListMultipleChoice, is there anyway to get the selected items before the submit by an ajax link for example because i wouldn’t refresh my page every time.

Thanks!

    // Liste des partenaires de l'offre.
final ListMultipleChoice partenairesSelec =
    new ListMultipleChoice("partenairesSelec", new Model((Serializable) partenairesSelected), new PropertyModel(
        offre,
        "partenaires"), renderer);


// Liste des domaines.
final DropDownChoice makes = new DropDownChoice("domaines", new PropertyModel(this, "selectedMake"), makeChoices) {
  @Override
  protected CharSequence getDefaultChoice(Object selected) {
    return new ArrayList<String>(modelsMap.keySet()).get(0);
  }
};

// Liste des partenaires disponibles.
final ListMultipleChoice partenairesChoice =
    new ListMultipleChoice("partenaires", new Model((Serializable) partenairesSelection), modelChoices, renderer);


// Action associé au changement du domaine.
makes.add(new AjaxFormComponentUpdatingBehavior("onchange") {
  @Override
  protected void onUpdate(AjaxRequestTarget target) {
    target.addComponent(partenairesChoice);
  }
});

// Bouton ajouter.
Button ajout = new Button("ajout") {
  @Override
  public void onSubmit() {
    if (partenairesSelection.size() != 0) {
      for (Partenaire p : partenairesSelection) {
        if (!partenairesSelected.contains(p)) {
          offre.getPartenaires().add(p);
          modelsMap.get(selectedMake).remove(p);
        }
      }
      offre.setPartenaires(sortPartenaireList(offre.getPartenaires()));
    }
  }
};

// Bouton supprimer.
Button suppr = new Button("suppr") {
  @Override
  public void onSubmit() {
    List<Partenaire> tmp = new ArrayList<Partenaire>();
    if (partenairesSelected.size() != 0) {
      for (Partenaire p : partenairesSelected) {
        if (!partenairesSelection.contains(p)) {
          Long id = p.getPartnerDomainId();
          tmp.add(p);
          for (String key : modelsMap.keySet()) {
            if (modelsMap.get(key).size() > 0 && modelsMap.get(key).get(0).getPartnerDomainId() == id) {
              modelsMap.get(key).add(p);
            }
          }
        }
      }
      for (Partenaire p : tmp) {
        offre.getPartenaires().remove(p);
      }
      offre.setPartenaires(sortPartenaireList(offre.getPartenaires()));
    }
  }
};
  • 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-24T04:44:00+00:00Added an answer on May 24, 2026 at 4:44 am

    AjaxFormChoiceComponentUpdatingBehavior is the class designed to do just that. Attach it to your component and you’ll get AJAX updates wherever the selection changes.

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

Sidebar

Related Questions

I have a question about django content_types In the example of filtering a QuerySet
I have a question about JSF and GET http request. How can I get
i have question about why should we use return in get,if dont use what
I have question about 301 Redirect please: example: http://stackapp.com/post/35642 to: http://google.com/posts/index.php?q=http://stackapp.com/post/35642 Note: I want
I'm learning asp.net. I have question about example buttons I can use two types
I have question about managing transaction in asp.net application. For example i have application
I have question about normalization. Suppose I have an applications dealing with songs. First
I have question about interpreting strings as packed binary data in C++. In python,
i have question about YAJLiOS parser... I have next json data : {{ body
I have a question about whether or not a specific way of applying of

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.