java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.behavior.AbstractAjaxBehavior
de.agilecoders.wicket.extensions.markup.html.bootstrap.form.typeahead.TypeaheadBehavior<T>
All Implemented Interfaces:
Serializable, IComponentAwareEventSink, IRequestListener, IComponentAwareHeaderContributor, IClusterable

public abstract class TypeaheadBehavior<T> extends AbstractAjaxBehavior
The behavior that returns JSON response for the typeahead widget.
See Also:
  • Constructor Details

    • TypeaheadBehavior

      public TypeaheadBehavior()
  • Method Details

    • onRequest

      public void onRequest()
    • createJson

      protected String createJson(Iterable<T> choices)
      Serializes the returned choices into JSON array.
      Parameters:
      choices - the choices for the term
      Returns:
      JSON array with all choices
    • getChoices

      protected abstract Iterable<T> getChoices(String input)
      Finds the possible choices for the provided input
      Parameters:
      input - the term provided by the user.
      Returns:
      a collection of all possible choices for this input