diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/help/HelpPageIdentifier.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/help/HelpPageIdentifier.java index 7af760f1156db8d5781ffa7d125c0440bfe7abf9..d4f5ead11526ce90baaa65771b4f4c8fb00388f5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/help/HelpPageIdentifier.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/help/HelpPageIdentifier.java @@ -182,7 +182,7 @@ public class HelpPageIdentifier // If there is no message for the key return the key as the title, // otherwise return the message. return messageProvider.containsKey(messageKey) ? messageProvider.getMessage(messageKey) - : messageKey; // TODO 2010-01-12, Piotr Buczek: is it better to return null? + : messageKey; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/file/AttachmentFileUploadField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/file/AttachmentFileUploadField.java index 71b0c7ca25fb7afdc0302a8c016bb45b599b03a5..51148eec747190ca54c8ca25cae6186d30966069 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/file/AttachmentFileUploadField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/file/AttachmentFileUploadField.java @@ -72,7 +72,7 @@ public class AttachmentFileUploadField extends FileUploadField } private String getFilePathValue() - {// FIXME: correct? + {// FIXME: this is only relative path, not absolute return getFileInput().getValue(); // its not only file name, but full file path } 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 96e7150aef79bc4c50f732d670c987945a5b1b98..980a830a67198f24fd81c1a71766c108095cfc27 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 @@ -205,6 +205,8 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod // finished. private ResultSetFetchConfig<String> pendingFetchConfigOrNull; + private boolean disableFetch = false; + private IDataRefreshCallback refreshCallback; private LayoutContainer bottomToolbars; @@ -379,10 +381,6 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod { if (resultSetKeyOrNull != null && pendingFetchConfigOrNull == null) { - // TODO 2009-09-16, Piotr Buczek: reload of data is not needed in some cases - // - when filters with no text are removed, - // - when new filters are created, - // but when filter with text is removed it is needed. ResultSetFetchConfig<String> fetchConfig = ResultSetFetchConfig.createFetchFromCache(resultSetKeyOrNull); reloadData(fetchConfig); @@ -504,7 +502,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod { if (pendingFetchConfigOrNull == null) { - // this can happen when we user wants to sort data - the refresh method is not called + // this can happen when user wants to sort data - the refresh method is not called if (resultSetKeyOrNull == null) { // data are not yet cached, so we ignore this call - should not really happen @@ -911,11 +909,18 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod pagingToolbar.disableExportButton(); pagingToolbar.updateDefaultConfigButton(false); + // We don't want to fetch data from cache when filters are reset. + // refresh() invokes fetching of data from DB and would be ignored because of a + // pending fetch. + disableFetch(); + // Need to reset filter fields *before* refreshing the grid so the list can be // correctly retrieved filterToolbar.resetFilterFields(); filterToolbar.resetFilterSelection(); + enableFetch(); + // export and config buttons are enabled when ListEntitiesCallback is complete refresh(); @@ -1056,10 +1061,12 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod // Refreshes the data, does not clear the cache. Does not change the column model. private void reloadData(ResultSetFetchConfig<String> resultSetFetchConfig) { - if (pendingFetchConfigOrNull != null) + if (isFetchDisabled() || pendingFetchConfigOrNull != null) { - debug("Cannot reload the data with the mode '" + resultSetFetchConfig - + "', there is an unfinished request already: " + pendingFetchConfigOrNull); + final String reason = + isFetchDisabled() ? "fetch is disabled" + : "there is an unfinished request already: " + pendingFetchConfigOrNull; + debug("Cannot reload the data with the mode '" + resultSetFetchConfig + "'; " + reason); return; } pendingFetchConfigOrNull = resultSetFetchConfig; @@ -1352,6 +1359,26 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod return new InternalLinkCellRenderer(); } + protected final boolean isFetchDisabled() + { + return disableFetch; + } + + protected final void disableFetch() + { + setDisableFetch(true); + } + + protected final void enableFetch() + { + setDisableFetch(false); + } + + private void setDisableFetch(boolean disableFetch) + { + this.disableFetch = disableFetch; + } + // ------- generic static helpers private static List<String> getFilteredColumnIds(List<ColumnDataModel> result)