Skip to content

Autocomplete TagIt

martin-g edited this page Sep 5, 2011 · 3 revisions

This project is an integration between Apache Wicket and Tag It (http://aehlke.github.com/tag-it/) - an extension of JQuery UI autocomplete component.

Usage

Add an instance of org.wicketstuff.tagit.TagItTextField to your form. For example:

form.add(new TagItTextField<String>("tagit", Model.of("")) {

        @Override
        protected Iterable<String> getChoices(String input) {            
            return suggestService.getSuggestions(input);
        }
});

TagItTextField.getChoices(String) method implementation should return a collection of possible choices for the passed input from the user.

After submit the form component value is a comma separated list of all chosen values.

To modify the default TagIt configuration you should override org.wicketstuff.tagit.TagItAjaxBehavior.getTagItConfig().

Clone this wiki locally