Module wicket.bootstrap.extensions
Class Prefetch
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 -
Method Summary
Modifier and TypeMethodDescriptionwithFilter(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.withUrl(CharSequence url) 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, wrapMethods inherited from class de.agilecoders.wicket.jquery.CombinableConfig
combine, withFallback
-
Constructor Details
-
Prefetch
public Prefetch()
-
-
Method Details
-
withUrl
A URL to a JSON file containing an array of datums. Required.- Parameters:
url- mandatory parameter- Returns:
- this instance for chaining
-
withTtl
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
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
-