diff --git a/Frameworks/D2W/ERModernLook/Sources/er/modern/look/pages/ERMODEditRelationshipPage.java b/Frameworks/D2W/ERModernLook/Sources/er/modern/look/pages/ERMODEditRelationshipPage.java index 5b6da19261a..7d3aa592ac4 100644 --- a/Frameworks/D2W/ERModernLook/Sources/er/modern/look/pages/ERMODEditRelationshipPage.java +++ b/Frameworks/D2W/ERModernLook/Sources/er/modern/look/pages/ERMODEditRelationshipPage.java @@ -225,6 +225,10 @@ public void relatedObjectDidChange(NSNotification notif) { EOEnterpriseObject obj = (EOEnterpriseObject)userInfo.valueForKey("object"); if (relationshipKey() != null && relationshipKey().equals(key) && ERXEOControlUtilities.eoEquals(masterObject(), obj)) { relationshipDisplayGroup().fetch(); + // when the last object of the last batch gets removed, select the new last batch + if (relationshipDisplayGroup().currentBatchIndex() > relationshipDisplayGroup().batchCount()) { + relationshipDisplayGroup().setCurrentBatchIndex(relationshipDisplayGroup().batchCount()); + } } } if (notif.userInfo().valueForKey("ajaxNotificationCenterId") == null) {