From af11cfd221deeef5fcb52b77eaadb265df389708 Mon Sep 17 00:00:00 2001 From: Fabian Peters Date: Fri, 2 Oct 2015 14:36:37 +0200 Subject: [PATCH] Switching from inspect to edit on a non-embedded page configuration will cause a page refresh. This change ensures the current tab will be kept active, as with an ajax update. The tab is identified via its name only, allowing for changes in the displayed property keys and the order of tabs. If the current tab is not available anymore, the first tab is selected. --- .../Sources/er/directtoweb/pages/ERD2WInspectPage.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/pages/ERD2WInspectPage.java b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/pages/ERD2WInspectPage.java index 919a439f6a1..74458fce1b9 100644 --- a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/pages/ERD2WInspectPage.java +++ b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/pages/ERD2WInspectPage.java @@ -22,6 +22,7 @@ import com.webobjects.foundation.NSDictionary; import com.webobjects.foundation.NSValidation; +import er.directtoweb.ERD2WContainer; import er.directtoweb.ERD2WFactory; import er.directtoweb.interfaces.ERDEditPageInterface; import er.directtoweb.interfaces.ERDFollowPageInterface; @@ -136,6 +137,15 @@ public WOComponent editAction() { EOEnterpriseObject object = ERXEOControlUtilities.editableInstanceOfObject(object(), createNestedContext); editPage.setObject(object); editPage.setNextPage(nextPage()); + if (currentTab() != null && editPage instanceof ERD2WPage) { + // try to keep the current tab selection + ERD2WPage tabPage = (ERD2WPage) editPage; + for (ERD2WContainer aTab : tabPage.tabSectionsContents()) { + if (aTab.equals(currentTab())) { + tabPage.setCurrentTab(aTab); + } + } + } returnPage = (WOComponent)editPage; } return returnPage != null ? returnPage : previousPage();