java.lang.Object
de.agilecoders.wicket.jquery.CombinableConfig
de.agilecoders.wicket.jquery.AbstractConfig
de.agilecoders.wicket.extensions.markup.html.bootstrap.form.typeahead.Dataset
All Implemented Interfaces:
de.agilecoders.wicket.jquery.Config, Serializable, IClusterable

public class Dataset extends de.agilecoders.wicket.jquery.AbstractConfig
See Also:
  • Constructor Details

    • Dataset

      public Dataset(String name)
  • Method Details

    • withName

      public Dataset withName(String name)
      The string used to identify the dataset. Used by typeahead.js to cache intelligently.
      Parameters:
      name - mandatory parameter
      Returns:
      this instance for chaining
    • withValueKey

      public Dataset withValueKey(String valueKey)
      The key used to access the value of the datum in the datum object. Defaults to value.
      Parameters:
      valueKey - mandatory parameter
      Returns:
      this instance for chaining
    • withLimit

      public Dataset withLimit(int limit)
      The key used to access the value of the datum in the datum object. Defaults to value.
      Parameters:
      limit - mandatory parameter
      Returns:
      this instance for chaining
    • withTemplate

      public Dataset withTemplate(String template)
      The template used to render suggestions. Can be a string or a precompiled template. If not provided, suggestions will render as their value contained in a

      element (i.e.

      value

      ).
      Parameters:
      template - mandatory parameter
      Returns:
      this instance for chaining
    • withEngine

      public Dataset withEngine(de.agilecoders.wicket.jquery.util.Json.RawValue engine)
      The engine used to render suggestions. Can be a string or a precompiled engine. If not provided, suggestions will render as their value contained in a

      element (i.e.

      value

      ). Example: #withEngine(new Json.RawValue("Hogan"))
      Parameters:
      engine - mandatory parameter
      Returns:
      this instance for chaining
    • withHeader

      public Dataset withHeader(String header)
      The header rendered before suggestions in the dropdown menu. Can be either a DOM element or HTML.
      Parameters:
      header - mandatory parameter
      Returns:
      this instance for chaining
    • withFooter

      public Dataset withFooter(String footer)
      The footer rendered before suggestions in the dropdown menu. Can be either a DOM element or HTML.
      Parameters:
      footer - mandatory parameter
      Returns:
      this instance for chaining
    • withRemote

      public Dataset withRemote(Remote remote)
      Can be a URL to fetch suggestions from when the data provided by local and prefetch is insufficient or, if more configurability is needed, a remote options object.
      Parameters:
      remote - mandatory parameter
      Returns:
      this instance for chaining
    • withPrefetch

      public Dataset withPrefetch(Prefetch prefetch)
      Prefetched data is fetched and processed on initialization. If the browser supports localStorage, the processed data will be cached there to prevent additional network requests on subsequent page loads.
      Parameters:
      prefetch - Prefetched data is fetched and processed on initialization.
      Returns:
      this instance for chaining
    • withLocal

      public <T> Dataset withLocal(List<T> local)
      A static list of datums.
      Parameters:
      local - A static list of datums..
      Returns:
      this instance for chaining
    • getRemote

      public Remote getRemote()