Select2MultiChoice lose display data after ajax update

377 views
Skip to first unread message

cosmi...@gmail.com

unread,
Mar 11, 2013, 6:22:34 AM3/11/13
to sel...@googlegroups.com
Hello Select2 friends,
I just started using wicket select2 library and I appreciate it very much.
I have 2 question about select2 wicket components.

1.
I added a select2multichoice in a form and after form processing, if one of fields validation fails display values of select2multichoice is lost although on getValue() the values are in.
onError I just refresh components as they have custom behaviour if validation fails. Is it a good way to handle each field validation?
Also placeholder text is lost. this doesn't happen for singlechoice component.
I initialize component like this:
language = new Select2MultiChoice<LanguageCODE>("language", new CollectionModel<LanguageCODE>(), new Select2LanguageCodeProvider(..));

2.Select2 generates a div for displaying and hande logic. May I get the wrapper's div markup id from code.

Thanks.

Igor Vaynberg

unread,
Mar 11, 2013, 1:18:09 PM3/11/13
to sel...@googlegroups.com
create a quickstart and attach it somewhere. hard to help you without that.

-igor
> --
> You received this message because you are subscribed to the Google Groups "select2" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
> To post to this group, send email to sel...@googlegroups.com.
> Visit this group at http://groups.google.com/group/select2?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Dumitrache Cosmin

unread,
Mar 15, 2013, 9:17:15 AM3/15/13
to sel...@googlegroups.com
Hello,
Sorry for delay.
I created a quick start. Here is the project: http://www.speedyshare.com/7tc8t/select2Demo.zip
If multiple select is invalid, the displayed is cleared but the selected values are not present in drop down list.
Thanks.

Dumitrache Cosmin

unread,
Mar 20, 2013, 4:52:09 AM3/20/13
to sel...@googlegroups.com
Hi again.
I don't want to be pushy but I don't know if you noticed I attached a project with select2multichoice. Here is the link: http://www.speedyshare.com/7tc8t/select2Demo.zip
If multiple choice is invalid (in my case less than 5 languages are selected) the component is refreshed by ajax. After refresh the component looses its display value, but
the selected values are not longer present in drop down options.
Kind regards.
 
 


luni, 11 martie 2013, 19:18:09 UTC+2, Igor Vaynberg a scris:

Igor Vaynberg

unread,
Mar 20, 2013, 8:04:32 PM3/20/13
to sel...@googlegroups.com
this is caused by a bug in wicket-select 1.0. upgrade to 2.1 where the
bug is fixed - unfortunately this version requires wicket 6, not sure
if its a problem for you or not. if it is look at the commits that led
up to 2.0 and see how the bug was fixed.

-igor

Dumitrache Cosmin

unread,
Mar 26, 2013, 11:33:05 AM3/26/13
to sel...@googlegroups.com
Hi,
We use wicket 1.5 but it was an easy fix now that you explained the problem.
Many thanks.
Reply all
Reply to author
Forward
0 new messages