Skip to content
Snippets Groups Projects
Commit e462fa01 authored by buczekp's avatar buczekp
Browse files

[LMS-1122] fixed label with a number of all items in a table

SVN: 12769
parent 339327bd
No related branches found
No related tags found
No related merge requests found
...@@ -127,7 +127,7 @@ public abstract class AbstractExternalDataGrid ...@@ -127,7 +127,7 @@ public abstract class AbstractExternalDataGrid
IBrowserGridActionInvoker invoker) IBrowserGridActionInvoker invoker)
{ {
return new DataSetUploadConfirmationDialog(dataSets, return new DataSetUploadConfirmationDialog(dataSets,
getSelectedAndDisplayedItemsAction(), getCount(), getSelectedAndDisplayedItemsAction(), getTotalCount(),
viewContext); viewContext);
} }
}); });
...@@ -278,7 +278,7 @@ public abstract class AbstractExternalDataGrid ...@@ -278,7 +278,7 @@ public abstract class AbstractExternalDataGrid
public SelectedAndDisplayedItems execute() public SelectedAndDisplayedItems execute()
{ {
return new SelectedAndDisplayedItems(getSelectedBaseObjects(), return new SelectedAndDisplayedItems(getSelectedBaseObjects(),
createTableExportCriteria(), getCount()); createTableExportCriteria(), getTotalCount());
} }
}; };
} }
......
...@@ -349,7 +349,7 @@ public class ExperimentBrowserGrid extends ...@@ -349,7 +349,7 @@ public class ExperimentBrowserGrid extends
public DisplayedAndSelectedExperiments execute() public DisplayedAndSelectedExperiments execute()
{ {
return new DisplayedAndSelectedExperiments(getSelectedBaseObjects(), return new DisplayedAndSelectedExperiments(getSelectedBaseObjects(),
createTableExportCriteria(), getCount()); createTableExportCriteria(), getTotalCount());
} }
}; };
} }
......
...@@ -194,6 +194,9 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod ...@@ -194,6 +194,9 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod
// result set key of the last refreshed data // result set key of the last refreshed data
private String resultSetKey; private String resultSetKey;
/** the number of all objects cached in the browser */
private int totalCount;
private IDataRefreshCallback refreshCallback; private IDataRefreshCallback refreshCallback;
protected AbstractBrowserGrid(final IViewContext<ICommonClientServiceAsync> viewContext, protected AbstractBrowserGrid(final IViewContext<ICommonClientServiceAsync> viewContext,
...@@ -644,6 +647,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod ...@@ -644,6 +647,7 @@ 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 // save the key of the result, later we can refer to the result in the cache using this
// key // key
saveCacheKey(result.getResultSetKey()); saveCacheKey(result.getResultSetKey());
totalCount = result.getTotalLength();
// convert the result to the model data for the grid control // convert the result to the model data for the grid control
final List<M> models = createModels(result.getList()); final List<M> models = createModels(result.getList());
final PagingLoadResult<M> loadResult = final PagingLoadResult<M> loadResult =
...@@ -1238,9 +1242,12 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod ...@@ -1238,9 +1242,12 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod
} }
/** @return the number of all objects cached in the browser */ /** @return the number of all objects cached in the browser */
public int getCount() public int getTotalCount()
{ {
return grid.getStore().getCount(); // FIXME takes only displayed items count // 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;
} }
private void refreshColumnsSettings() private void refreshColumnsSettings()
...@@ -1559,7 +1566,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod ...@@ -1559,7 +1566,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod
{ {
// > 0 entity selected - show dialog with all/selected radio // > 0 entity selected - show dialog with all/selected radio
new ShowRelatedDatasetsDialog(viewContext, selectedEntities, displayedEntities, browser new ShowRelatedDatasetsDialog(viewContext, selectedEntities, displayedEntities, browser
.getCount()).show(); .getTotalCount()).show();
} }
} }
} }
...@@ -648,7 +648,7 @@ public class SampleBrowserGrid extends ...@@ -648,7 +648,7 @@ public class SampleBrowserGrid extends
public DisplayedAndSelectedSamples execute() public DisplayedAndSelectedSamples execute()
{ {
return new DisplayedAndSelectedSamples(getSelectedBaseObjects(), return new DisplayedAndSelectedSamples(getSelectedBaseObjects(),
createTableExportCriteria(), getCount()); createTableExportCriteria(), getTotalCount());
} }
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment