diff --git a/web/src/main/java/org/phoenixctms/ctsms/web/model/shared/JournalEntryLazyModel.java b/web/src/main/java/org/phoenixctms/ctsms/web/model/shared/JournalEntryLazyModel.java index d9508befd075..fa039c2e6ac2 100644 --- a/web/src/main/java/org/phoenixctms/ctsms/web/model/shared/JournalEntryLazyModel.java +++ b/web/src/main/java/org/phoenixctms/ctsms/web/model/shared/JournalEntryLazyModel.java @@ -7,6 +7,7 @@ import org.phoenixctms.ctsms.exception.AuthenticationException; import org.phoenixctms.ctsms.exception.AuthorisationException; import org.phoenixctms.ctsms.exception.ServiceException; +import org.phoenixctms.ctsms.util.CommonUtil; import org.phoenixctms.ctsms.vo.JournalEntryOutVO; import org.phoenixctms.ctsms.vo.PSFVO; import org.phoenixctms.ctsms.web.model.LazyDataModelBase; @@ -24,9 +25,12 @@ public Long getEntityId() { @Override protected Collection getLazyResult(PSFVO psf) { if (module != null && entityId != null) { + if (psf != null) { + psf.setUpdateRowCount(false); + } try { return WebUtil.getServiceLocator().getJournalService().getJournal(WebUtil.getAuthentication(), module, entityId, psf); - } catch (ServiceException|AuthorisationException|IllegalArgumentException e) { + } catch (ServiceException | AuthorisationException | IllegalArgumentException e) { } catch (AuthenticationException e) { WebUtil.publishException(e); } @@ -34,6 +38,11 @@ protected Collection getLazyResult(PSFVO psf) { return new ArrayList(); } + @Override + public void updateRowCount() { + setRowCount(CommonUtil.safeLongToInt(CommonUtil.fromCountLimitExceeded(WebUtil.getJournalCountSafe(module, entityId)))); + } + public JournalModule getModule() { return module; }