Hi Frank ,
Are you sure that your dao is setting max results on the underlying
query? The provider.iterator(...) should only be returning the current
page values and typically the page size would be small like 25 to 100.
Also it depends on your backend database since I know that some (older
version of PostgreSQL) have issues with doing a SELECT ... ORDER BY X
LIMIT Y without looking at all of the values in the unlimited select.
If the total number of rows is reasonable (say several 1000) then just
return the full list into Java and then use a Comparator to sort the
loaded data according to the sort property.
In terms of handling this issue in your interface you can just have
another component render based on the value from the provider. If you
can cache the results of the provider like the loadable detachable model
does then there will only be 1 hit on the db and then you can show zero
rows in the table and an error message label.
Regards,
Mike
Breaking my head on the following, hopefully someone might be able to
give me a hint?
In a page which serves a view on a log database with quite a lot of
rows, I am using a DataTable to show the rows. The data for the table is
being served by a SortableDataProvider which looks a bit like this:
<...>
public SortableSystemlogDataProvider(Map searchParams) {
// creating new instance, set default sorting, Search parameters,
counting dataset
this.dao = new H2InterfaceDaoImpl();
setSort("sl_id", false);
this.searchParams = searchParams;
this.systemlogListSize = dao.countAllSystemlogRows(searchParams);
}
public Iterator iterator(int first, int count) {
SortParam sp = getSort();
if (sp.getProperty() == null) {
setSort("sl_id", false);
sp = getSort();
}
// return iterator on search list by params
paginatedList = dao.selectSystemlogs(this.searchParams,
sp.getProperty(), sp.isAscending(), first, count);
return paginatedList.iterator();
}
<...>
The issue I am running into at this moment is this: in case of large
datasets, the db call from within the iterator gives a timeout, and
returns null. In this case I would like to give the user a warning
modalwindow and the possibility to change the search options. Of course
I am able to catch the timeout, and return an empty set, but I cannot
see how to move on from that, as I am already within the DataTable.
Anyone has an idea on this?
Thanks in advance, regards,
Frank Prins
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org