public abstract class AbstractVirtualScrollResourceReference<T> extends ResourceReference
ResourceReference.Key, ResourceReference.LambdaResourceReference, ResourceReference.UrlAttributes
Modifier and Type | Field and Description |
---|---|
static String |
ASCENDING_DIRECTION |
static String |
DATA_RESPONSE_FIELD |
static String |
DESCENDING_DIRECTION |
static String |
DRAW_PARAMETER |
static String |
DRAW_RESPONSE_FIELD |
static String |
LENGTH_PARAMETER |
static String |
ORDER_0_COLUMN_PARAMETER |
static String |
ORDER_0_DIRECTION_PARAMETER |
static String |
RECORDS_FILTERED_RESPONSE_FIELD |
static String |
RECORDS_TOTAL_RESPONSE_FIELD |
static String |
SEARCH_REGEX_PARAMETER |
static String |
SEARCH_VALUE_PARAMETER |
static String |
START_PARAMETER |
Constructor and Description |
---|
AbstractVirtualScrollResourceReference(Class<?> scope,
String name) |
AbstractVirtualScrollResourceReference(Class<?> scope,
String name,
Locale locale,
String style,
String variation) |
AbstractVirtualScrollResourceReference(ResourceReference.Key key) |
AbstractVirtualScrollResourceReference(String name) |
Modifier and Type | Method and Description |
---|---|
protected String |
generateResponse(PageParameters parameters)
Generates the JSON response for infinite scrolling/paging.
|
protected abstract IDataProvider<T> |
getDataProvider(PageParameters parameters) |
protected int |
getDefaultLength()
Sometimes DataTables confuses itself and send NaN as a value for the
length parameter.
|
protected int |
getDefaultStart() |
IResource |
getResource() |
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 response
|
canBeRegistered, equals, getDependencies, getExtension, getKey, getLocale, getName, getScope, getStyle, getUrlAttributes, getVariation, hashCode, of, of, toString
public static final String LENGTH_PARAMETER
public static final String START_PARAMETER
public static final String DRAW_PARAMETER
public static final String ORDER_0_COLUMN_PARAMETER
public static final String ORDER_0_DIRECTION_PARAMETER
public static final String ASCENDING_DIRECTION
public static final String DESCENDING_DIRECTION
public static final String SEARCH_VALUE_PARAMETER
public static final String SEARCH_REGEX_PARAMETER
public static final String RECORDS_TOTAL_RESPONSE_FIELD
public static final String RECORDS_FILTERED_RESPONSE_FIELD
public static final String DRAW_RESPONSE_FIELD
public static final String DATA_RESPONSE_FIELD
public AbstractVirtualScrollResourceReference(ResourceReference.Key key)
public AbstractVirtualScrollResourceReference(Class<?> scope, String name, Locale locale, String style, String variation)
public AbstractVirtualScrollResourceReference(Class<?> scope, String name)
public AbstractVirtualScrollResourceReference(String name)
public IResource getResource()
getResource
in class ResourceReference
protected String generateResponse(PageParameters parameters)
parameters
- The request parametersprotected void populateDataJson(com.github.openjson.JSONObject response, IDataProvider<T> dataProvider)
protected abstract void populateEntryJson(com.github.openjson.JSONObject entryJson, T dataEntry)
entryJson
- The JSON object to populatedataEntry
- The data entry returned by the data provider
protected abstract IDataProvider<T> getDataProvider(PageParameters parameters)
protected int getDefaultStart()
protected int getDefaultLength()
Copyright © 2019. All rights reserved.