Class AbstractVirtualScrollResourceReference<T>
java.lang.Object
org.apache.wicket.request.resource.ResourceReference
org.wicketstuff.datatables.virtualscroll.AbstractVirtualScrollResourceReference<T>
- All Implemented Interfaces:
Serializable
,IClusterable
An abstract resource reference that could be used as a base for custom implementations
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.ResourceReference
ResourceReference.Key, ResourceReference.LambdaResourceReference, ResourceReference.UrlAttributes
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractVirtualScrollResourceReference
(Class<?> scope, String name) AbstractVirtualScrollResourceReference
(Class<?> scope, String name, Locale locale, String style, String variation) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
generateResponse
(PageParameters parameters) Generates the JSON response for infinite scrolling/paging.protected abstract IDataProvider<T>
getDataProvider
(PageParameters parameters) protected int
Sometimes DataTables confuses itself and send NaN as a value for the length parameter.protected int
protected void
populateDataJson
(com.github.openjson.JSONObject response, IDataProvider<T> dataProvider) protected abstract void
populateEntryJson
(com.github.openjson.JSONObject entryJson, T dataEntry) A callback method that should populate the JSON object for a single entry in the responseMethods inherited from class org.apache.wicket.request.resource.ResourceReference
canBeRegistered, equals, getDependencies, getExtension, getKey, getLocale, getName, getScope, getStyle, getUrlAttributes, getVariation, hashCode, of, of, toString
-
Field Details
-
LENGTH_PARAMETER
- See Also:
-
START_PARAMETER
- See Also:
-
DRAW_PARAMETER
- See Also:
-
ORDER_0_COLUMN_PARAMETER
- See Also:
-
ORDER_0_DIRECTION_PARAMETER
- See Also:
-
ASCENDING_DIRECTION
- See Also:
-
DESCENDING_DIRECTION
- See Also:
-
SEARCH_VALUE_PARAMETER
- See Also:
-
SEARCH_REGEX_PARAMETER
- See Also:
-
RECORDS_TOTAL_RESPONSE_FIELD
- See Also:
-
RECORDS_FILTERED_RESPONSE_FIELD
- See Also:
-
DRAW_RESPONSE_FIELD
- See Also:
-
DATA_RESPONSE_FIELD
- See Also:
-
-
Constructor Details
-
AbstractVirtualScrollResourceReference
-
AbstractVirtualScrollResourceReference
-
AbstractVirtualScrollResourceReference
-
AbstractVirtualScrollResourceReference
-
-
Method Details
-
getResource
- Specified by:
getResource
in classResourceReference
-
generateResponse
Generates the JSON response for infinite scrolling/paging. See DataTables server side docs.- Parameters:
parameters
- The request parameters- Returns:
-
populateDataJson
protected void populateDataJson(com.github.openjson.JSONObject response, IDataProvider<T> dataProvider) -
populateEntryJson
A callback method that should populate the JSON object for a single entry in the response- Parameters:
entryJson
- The JSON object to populatedataEntry
- The data entry returned by thedata provider
-
getDataProvider
- Returns:
- The provider of the data for the table
-
getDefaultStart
protected int getDefaultStart()- Returns:
- A default value for the start request parameter for the cases when DataTables sends non-numeric value, like Nan
-
getDefaultLength
protected int getDefaultLength()Sometimes DataTables confuses itself and send NaN as a value for the length parameter.- Returns:
- The default value of length when DataTables cannot calculate a good value for some reason
-