To get selected rows, it easy.
But how to get all rows on current page?
And how to get all rows from all pages (a filter is aplied so it is not a SELECT * FROM ATABLE…)?
And BTW, how to do “Select All rows” on the GUI / DataGrid? Is it possible? And with a shortcut?
Thank you very much in advance.
NOTE: I tried Excel or JSON technique, but failed:
OK, I was able to do it like this.
I was not able to get all rows.
I so I made my own new query.
The bad thing is, that it does not respect the UI Filters…
private Collection<Object> getItemsForReport(ExportMode exportMode) {
if (exportMode == ExportMode.ALL_ROWS) {
List<ApplicationForm> afs = dataManager.load(ApplicationForm.class)
.query("select a from ApplicationForm a where a.espApplicationStatus = :espApplicationStatus1")
.parameter("espApplicationStatus1", status.getId())
.list();
return new ArrayList<>(afs);
} else {
return ExportMode.CURRENT_PAGE == exportMode
? applicationFormsStatusTable.getItems().getItems().collect(Collectors.toList())
: new ArrayList<>(applicationFormsStatusTable.getSelected());
}
}