Module wicket.bootstrap.extensions
Class Dataset
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionwithEngine(de.agilecoders.wicket.jquery.util.Json.RawValue engine) The engine used to render suggestions.withFooter(String footer) The footer rendered before suggestions in the dropdown menu.withHeader(String header) The header rendered before suggestions in the dropdown menu.withLimit(int limit) The key used to access the value of the datum in the datum object.<T> DatasetA static list of datums.The string used to identify the dataset.withPrefetch(Prefetch prefetch) Prefetched data is fetched and processed on initialization.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.withTemplate(String template) The template used to render suggestions.withValueKey(String valueKey) The key used to access the value of the datum in the datum object.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
-
Dataset
-
-
Method Details
-
withName
The string used to identify the dataset. Used by typeahead.js to cache intelligently.- Parameters:
name- mandatory parameter- Returns:
- this instance for chaining
-
withValueKey
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
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
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 aelement (i.e.
value
).- Parameters:
template- mandatory parameter- Returns:
- this instance for chaining
-
withEngine
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 aelement (i.e.
value
). Example: #withEngine(new Json.RawValue("Hogan"))- Parameters:
engine- mandatory parameter- Returns:
- this instance for chaining
-
withHeader
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
-
withRemote
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
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
A static list of datums.- Parameters:
local- A static list of datums..- Returns:
- this instance for chaining
-
getRemote
-