summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorelmot <elmot@vaadin.com>2016-08-16 15:47:02 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2016-08-17 08:33:22 +0000
commit7373b232f945bbb83d92f5032bea78ad0e3f2c07 (patch)
tree85ac2f1f4d047b2eaaf8ceb8d372c6336060f176 /documentation
parentd96a6346996a170afcd25d4b785b994b01883099 (diff)
downloadvaadin-framework-7373b232f945bbb83d92f5032bea78ad0e3f2c07.tar.gz
vaadin-framework-7373b232f945bbb83d92f5032bea78ad0e3f2c07.zip
DataSource backend sorting
Change-Id: Ic9e12534cf85f7793a57436e63bd67b6f920f722
Diffstat (limited to 'documentation')
-rw-r--r--documentation/datamodel/datamodel-datasources.asciidoc12
1 files changed, 6 insertions, 6 deletions
diff --git a/documentation/datamodel/datamodel-datasources.asciidoc b/documentation/datamodel/datamodel-datasources.asciidoc
index ddc78bc6cf..997ad20207 100644
--- a/documentation/datamodel/datamodel-datasources.asciidoc
+++ b/documentation/datamodel/datamodel-datasources.asciidoc
@@ -152,7 +152,7 @@ Information about which items to fetch as well as some additional details are ma
[source, java]
----
-DataSource<Person> dataSource = new DataSource<>(
+DataSource<Person> dataSource = new BackendDataSource<>(
// First callback fetches items based on a query
query -> {
// The index of the first item to load
@@ -197,7 +197,7 @@ public interface PersonService {
int getPersonCount();
- static PersonSort createSort(
+ PersonSort createSort(
String propertyName,
boolean descending);
}
@@ -208,11 +208,11 @@ The sorting options set through the component will be available through [interfa
[source, java]
----
-DataSource<Person> dataSource = new DataSource<>(
+DataSource<Person> dataSource = new BackEndDataSource<>(
query -> {
List<PersonSort> sortOrders = new ArrayList<>();
for(SortOrder<String> queryOrder : query.getSortOrders()) {
- PersonSort sort = PersonService.createSort(
+ PersonSort sort = getPersonService().createSort(
// The name of the sorted property
queryOrder.getSorted(),
// The sort direction for this property
@@ -220,7 +220,7 @@ DataSource<Person> dataSource = new DataSource<>(
sortOrders.add(sort);
}
- return service.fetchPersons(
+ return getPersonService().fetchPersons(
query.getOffset(),
query.getLimit(),
sortOrders
@@ -329,7 +329,7 @@ We can create a helper method for handling the filter since the same logic is ne
[source, java]
----
-DataSource<Person> dataSource = new DataSource<>(
+DataSource<Person> dataSource = new BackEndDataSource<>(
query -> {
BackendFilter filter = query.getFilter();