Type Parameters:
T -
All Implemented Interfaces:
Serializable, IComponentAwareEventSink, IRequestListener, IComponentAwareHeaderContributor, 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:
  • Constructor Details

  • Method Details

    • onBind

      protected void onBind()
      Description copied from class: AbstractDefaultAjaxBehavior
      Subclasses should call super.onBind()
      Overrides:
      onBind in class AbstractDefaultAjaxBehavior
      See Also:
    • onRequest

      protected final void onRequest(String val, 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(Component component)
      Description copied from class: Behavior
      Allows the behavior to detach any state it has attached during request processing.
      Overrides:
      detach in class Behavior
      Parameters:
      component - the component that initiates the detachment of this behavior