IDEMPIERE-2700 Zoom to detail is not honoring the configuration of tab grid/form

This commit is contained in:
Carlos Ruiz 2015-06-26 09:24:27 -05:00
parent 35f0b830a0
commit 2183eb44ef
2 changed files with 6 additions and 4 deletions

View File

@ -527,8 +527,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
{ {
setActiveTab(gridWindow.getTabIndex(gTab), null); setActiveTab(gridWindow.getTabIndex(gTab), null);
gTab.navigate(i); gTab.navigate(i);
if (gc.isGridView())
gc.switchRowPresentation();
return true; return true;
} }
} }

View File

@ -890,8 +890,10 @@ public class CompositeADTabbox extends AbstractADTabbox
if (!tabPanel.isVisible()) { if (!tabPanel.isVisible()) {
tabPanel.setVisible(true); tabPanel.setVisible(true);
} }
boolean wasForm = false;
if (!tabPanel.isGridView()) { if (!tabPanel.isGridView()) {
tabPanel.switchRowPresentation(); tabPanel.switchRowPresentation(); // required to avoid NPE on GridTabRowRenderer.getCurrentRow below
wasForm = true;
} }
tabPanel.setDetailPaneMode(true); tabPanel.setDetailPaneMode(true);
headerTab.getDetailPane().setVflex("true"); headerTab.getDetailPane().setVflex("true");
@ -904,7 +906,9 @@ public class CompositeADTabbox extends AbstractADTabbox
Row row = gtr.getCurrentRow(); Row row = gtr.getCurrentRow();
if (row != null) if (row != null)
gtr.setCurrentRow(row); gtr.setCurrentRow(row);
} }
if (wasForm && tabPanel.getTabLevel() == 0 && headerTab.getTabLevel() != 0) // maintain form on header when zooming to a detail tab
tabPanel.switchRowPresentation();
} }
private void showLastError() { private void showLastError() {