Skip to content

Commit

Permalink
Switching from inspect to edit on a non-embedded page configuration w…
Browse files Browse the repository at this point in the history
…ill 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.
  • Loading branch information
fbarthez authored and darkv committed Nov 29, 2015
1 parent b434d5c commit af11cfd
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit af11cfd

Please sign in to comment.