diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java index bf8e7b375281a660ae28b37fcecbddefa7d8001e..beb6ceedc21eacf2095b43f728263ec19486deb9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java @@ -198,9 +198,6 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod // result set key of the last refreshed data private String resultSetKey; - /** the number of all objects cached in the browser */ - private int totalCount; - private IDataRefreshCallback refreshCallback; protected AbstractBrowserGrid(final IViewContext<ICommonClientServiceAsync> viewContext, @@ -618,7 +615,6 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod // save the key of the result, later we can refer to the result in the cache using this // key saveCacheKey(result.getResultSetKey()); - totalCount = result.getTotalLength(); GridRowModels<T> rowModels = result.getList(); List<GridCustomColumnInfo> customColumnMetadata = rowModels.getCustomColumnsMetadata(); customColumnsMetadataProvider.setCustomColumnsMetadata(customColumnMetadata); @@ -1265,10 +1261,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod /** @return the number of all objects cached in the browser */ public int getTotalCount() { - // NOTE: Maybe there is a better way to get this value without keeping it on field variable. - // Bottom toolbar displays it so there has to be access to this, but e.g. - // grid.getStore().getCount() returns only number of items displayed on the current page. - return totalCount; + return pagingToolbar.getTotalCount(); } private void refreshColumnsSettings() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java index 7d127146e0fe95d784a2208d9a144926a77ef8f9..8124a38362e54f01bdebdfa94ba771c8d5a8ead6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java @@ -77,6 +77,12 @@ public final class BrowserGridPagingToolBar extends PagingToolBarAdapter add(exportButton); } + /** Total number of items on all pages */ + public int getTotalCount() + { + return totalLength; + } + private void add(Widget widget) { add(new AdapterToolItem(widget));