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

public class Prefetch extends de.agilecoders.wicket.jquery.AbstractConfig
Configuration for Twitter Typeahead's prefetch setting.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    withFilter(de.agilecoders.wicket.jquery.util.Json.RawValue filter)
    A function with the signature filter(parsedResponse) that transforms the response body into an array of datums.
    withTtl(long ttl)
    The time (in milliseconds) the prefetched data should be cached in localStorage.
    A URL to a JSON file containing an array of datums.

    Methods inherited from class de.agilecoders.wicket.jquery.AbstractConfig

    all, contains, get, getString, isEmpty, newKey, put, remove, toJsonString, wrap

    Methods inherited from class de.agilecoders.wicket.jquery.CombinableConfig

    combine, withFallback

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Prefetch

      public Prefetch()
  • Method Details

    • withUrl

      public Prefetch withUrl(CharSequence url)
      A URL to a JSON file containing an array of datums. Required.
      Parameters:
      url - mandatory parameter
      Returns:
      this instance for chaining
    • withTtl

      public Prefetch withTtl(long ttl)
      The time (in milliseconds) the prefetched data should be cached in localStorage. Defaults to 86400000 (1 day).
      Parameters:
      ttl - the time (in milliseconds) the prefetched data should be cached in localStorage.
      Returns:
      this instance for chaining
    • withFilter

      public Prefetch withFilter(de.agilecoders.wicket.jquery.util.Json.RawValue filter)
      A function with the signature filter(parsedResponse) that transforms the response body into an array of datums. Expected to return an array of datums.
      Parameters:
      filter - A function with the signature filter(parsedResponse) that transforms the response body into an array of datums
      Returns:
      this instance for chaining