wicket DropDownChoice jump to certain selection

556 Views Asked by At

I am using wicket DropDownChoice and my list is very long, is there a way that when i click the drop down list and then click on a character the list will jump to the first select that start with the same character

1

There are 1 best solutions below

0
On

I know this is not the exact solution to your problem, but it will solve your functional issue. If you have very long select list, I would recommend loading it progressively with a search field via Ajax.

wicket-select2 is such a (wonderful) wicket component, integrating the select2 library into wicket to provide Ajax filtering, custom rendering, etc. Although the current integration doesn't offer a way to simply add the select2 behaviour to a static non ajax DropDownChoice, it's relatively easy to do by using wicket-select2's classes as a base. For the wicket-select2 integration all you'll need is to use Select2Choice (or Select2MultiChoice for multiple selects) to which you pass a simple TextChoiceProvider

After you start using such a component, you don't really want to go back to plain old selects, in particular if you have long lists of choices.

Note : using 1.5.8 (and previously 1.4.x), the old selects in my application display the behaviour you are looking for, e.g. standard html behaviour. However from what I understood you don't use a <select> tag in your markup for your DropDownChoice: what are you using then (it's likely this is the cause of your issue).