java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.behavior.AbstractAjaxBehavior
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
org.apache.wicket.extensions.ajax.markup.html.autocomplete.AbstractAutoCompleteBehavior
org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteBehavior<T>
Type Parameters:
T -
All Implemented Interfaces:
Serializable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.IRequestListener, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, org.apache.wicket.util.io.IClusterable

public abstract class AutoCompleteBehavior<T> extends AbstractAutoCompleteBehavior
This behavior builds on top of AbstractAutoCompleteBehavior by introducing the concept of a IAutoCompleteRenderer to make response writing easier.
Since:
1.2
Author:
Igor Vaynberg (ivaynberg), Janne Hietamäki (jannehietamaki)
See Also:
  • Field Summary

    Fields inherited from class org.apache.wicket.extensions.ajax.markup.html.autocomplete.AbstractAutoCompleteBehavior

    AUTOCOMPLETE_JS, settings

    Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior

    INDICATOR
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
    AutoCompleteBehavior(IAutoCompleteRenderer<T> renderer, boolean preselect)
    Constructor
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    detach(org.apache.wicket.Component component)
     
    protected abstract Iterator<T>
    Callback method that should return an iterator over all possible choice objects.
    protected void
     
    protected final void
    onRequest(String val, org.apache.wicket.request.cycle.RequestCycle requestCycle)
    Callback for the ajax event generated by the javascript.

    Methods inherited from class org.apache.wicket.extensions.ajax.markup.html.autocomplete.AbstractAutoCompleteBehavior

    constructSettingsJS, renderHead, respond, updateAjaxAttributes

    Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior

    findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onMethodMismatch, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes

    Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior

    afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind

    Methods inherited from class org.apache.wicket.behavior.Behavior

    beforeRender, canCallListener, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.wicket.IRequestListener

    rendersPage
  • Constructor Details

  • Method Details

    • onBind

      protected void onBind()
      Overrides:
      onBind in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
    • onRequest

      protected final void onRequest(String val, org.apache.wicket.request.cycle.RequestCycle requestCycle)
      Description copied from class: AbstractAutoCompleteBehavior
      Callback for the ajax event generated by the javascript. This is where we need to generate our response.
      Specified by:
      onRequest in class AbstractAutoCompleteBehavior
      Parameters:
      val - the input entered so far
      requestCycle - current request cycle
    • getChoices

      protected abstract Iterator<T> getChoices(String input)
      Callback method that should return an iterator over all possible choice objects. These objects will be passed to the renderer to generate output. Usually it is enough to return an iterator over strings.
      Parameters:
      input - current input
      Returns:
      iterator over all possible choice objects
    • detach

      public void detach(org.apache.wicket.Component component)
      Overrides:
      detach in class org.apache.wicket.behavior.Behavior