-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to be notified of selected choices? #84
Comments
No problem, simply do something like this: Select2MultiChoice<String> multiChoice = new Select2MultiChoice<String>(
"multiChoice", model, choiceProvider);
form.add(multiChoice);
multiChoice.add(new AjaxEventBehavior("change")
{
@Override
protected void onEvent(AjaxRequestTarget target)
{
// do something useful here
}
}); |
Ah ok, if you'd like to sync on each change then you better do something like this: multiChoice.add(new AjaxFormSubmitBehavior(form, "change")
{
@Override
protected void onSubmit(AjaxRequestTarget target)
{
// do something useful here
}
}); |
Thanks Tom! Will this submit the whole form or just the items in the MultiChoice? |
This will submit the whole form. If you just want to submit the values of the MultiChoice, try org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior. |
I already tried that using: The IModel isnt being updated as expected - hence this question :-) |
Just tried AjaxFormComponentUpdatingBehavior in a quickstart and it works fine for me ... |
Igor - is there any way to be notified via a callback of a user selection in a Select2MultiChoice?
Ive got the component hooked up and working fine, complete with search function, but Im trying to sync the selected items in the MultiChoice after each user selection - is this possible?
The text was updated successfully, but these errors were encountered: