All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<T,FormComponent<T>>, IMetadataContext<Serializable,Component>, IFormModelUpdateListener, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class Typeahead<T> extends TextField<T>
An integration with Twitter Typeahead plugin.
See Also:
  • Constructor Details

    • Typeahead

      public Typeahead(String markupId, Dataset config)
      Constructor.
      Parameters:
      markupId - The component's id
      config - The typeahead configuration
    • Typeahead

      public Typeahead(String markupId, IModel<T> model, Dataset config)
      Constructor.
      Parameters:
      markupId - The component's id
      model - The textfield value
      config - The typeahead configuration
  • Method Details

    • size

      public Typeahead<T> size(de.agilecoders.wicket.core.markup.html.bootstrap.layout.col.SpanType size)
      sets the size of textfield
      Parameters:
      size - mandatory parameter
      Returns:
      this instance for chaining
    • size

      public Typeahead<T> size(de.agilecoders.wicket.core.markup.html.bootstrap.form.InputBehavior.Size size)
      sets the size of textfield
      Parameters:
      size - mandatory parameter
      Returns:
      this instance for chaining
    • remote

      public Typeahead<T> remote(boolean remote)
      Disables/Enables the remote functionality for this component
      Parameters:
      remote - a flag indicating whether the Typeahead uses remote data source
      Returns:
      this instance for chaining
    • createTypeaheadBehavior

      protected TypeaheadBehavior<T> createTypeaheadBehavior()
    • getChoices

      protected Iterable<T> getChoices(String input)
      Returns an iterable with all choices that match the provided input.
      Parameters:
      input - The input to match against to.
      Returns:
      All matching choices.
    • onComponentTag

      protected void onComponentTag(ComponentTag tag)
      Overrides:
      onComponentTag in class TextField<T>
    • renderHead

      public void renderHead(IHeaderResponse response)
      Specified by:
      renderHead in interface IHeaderContributor
      Overrides:
      renderHead in class Component
    • newTypeaheadJsHeaderItem

      protected HeaderItem newTypeaheadJsHeaderItem()