Hi,

If you only need a static list of initial choices (non ajax), you should be able to simply use select2's tagging support with something like (didn't test it):
// model is your IModel<String> for the selected data
Select2Choice<String> choice = new Select2Choice<String>("choice", model);
choice.getSettings().setTags("A", "B", "C");

You can of course also use a Select2MultiChoice for multiple choices.

Now if you need Ajax support, it's somewhat more complex, though for the simple case where you don't need to mix static choices and ajax, you could use a standard Select2Choice (or MultiChoice), and in the query method of your choice provider prepend the query string to the list of results.


On Wed 12 Sep 2012 11:33:38 CEST, Thomas Götz wrote:
I want to use wicket-select2 as a replacement for Wicket's AutoCompleteTextField. Is it 
somehow possible to accept user input that is not contained in the list of choices? Say, 
my choices list returns [A, B, C] but user may also enter "D" in the textfield. 
How can I achieve this?

    -Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to