From 87d29ef56e7c94f077a4c695034503d1f636977d Mon Sep 17 00:00:00 2001 From: Teo Sarca Date: Thu, 2 Mar 2017 00:02:36 +0200 Subject: [PATCH] #19 minor refactoring --- .../de/metas/ui/web/window/model/DocumentCollection.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/metasfresh-webui-api/src/main/java/de/metas/ui/web/window/model/DocumentCollection.java b/metasfresh-webui-api/src/main/java/de/metas/ui/web/window/model/DocumentCollection.java index 1ef64596f..6cc310160 100644 --- a/metasfresh-webui-api/src/main/java/de/metas/ui/web/window/model/DocumentCollection.java +++ b/metasfresh-webui-api/src/main/java/de/metas/ui/web/window/model/DocumentCollection.java @@ -92,14 +92,14 @@ public Document load(final DocumentKey documentKey) public void onReset(String tableName, int recordId) { getDocumentPaths(tableName, recordId) - .forEach(documentPath -> forDocumentReadonlyIfLoaded(documentPath, document -> document.refreshFromRepository())); + .forEach(documentPath -> invalidateDocumentByPath(documentPath)); } }; /* package */ DocumentCollection() { super(); - + CacheMgt.get().addCacheMgtListener(cacheMgtListener); } @@ -257,6 +257,11 @@ public R forRootDocumentWritable(final DocumentPath documentPathOrNew, final } } + private final void invalidateDocumentByPath(final DocumentPath documentPath) + { + forDocumentReadonlyIfLoaded(documentPath, document -> document.refreshFromRepository()); + } + /** * Creates a new root document. *