Module wicket.bootstrap.extensions
Class TypeaheadBehavior<T>
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
The behavior that returns JSON response for the typeahead widget.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateJson(Iterable<T> choices) Serializes the returned choices into JSON array.getChoices(String input) Finds the possible choices for the provided inputvoidMethods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior
afterRender, bind, getCallbackUrl, getComponent, onBind, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbindMethods inherited from class org.apache.wicket.behavior.Behavior
beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag, renderHeadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.wicket.IRequestListener
rendersPage
-
Constructor Details
-
TypeaheadBehavior
public TypeaheadBehavior()
-
-
Method Details
-
onRequest
public void onRequest() -
createJson
Serializes the returned choices into JSON array.- Parameters:
choices- the choices for the term- Returns:
- JSON array with all choices
-
getChoices
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
-