From 2183eb44efedde5bf38671b45c747223d960ce8a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 26 Jun 2015 09:24:27 -0500 Subject: [PATCH] IDEMPIERE-2700 Zoom to detail is not honoring the configuration of tab grid/form --- .../adempiere/webui/adwindow/AbstractADWindowContent.java | 2 -- .../org/adempiere/webui/adwindow/CompositeADTabbox.java | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 25198d1235..52e2c75d2e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -527,8 +527,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { setActiveTab(gridWindow.getTabIndex(gTab), null); gTab.navigate(i); - if (gc.isGridView()) - gc.switchRowPresentation(); return true; } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java index cd733dfd6d..5c7e4c05ca 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java @@ -890,8 +890,10 @@ public class CompositeADTabbox extends AbstractADTabbox if (!tabPanel.isVisible()) { tabPanel.setVisible(true); } + boolean wasForm = false; if (!tabPanel.isGridView()) { - tabPanel.switchRowPresentation(); + tabPanel.switchRowPresentation(); // required to avoid NPE on GridTabRowRenderer.getCurrentRow below + wasForm = true; } tabPanel.setDetailPaneMode(true); headerTab.getDetailPane().setVflex("true"); @@ -904,7 +906,9 @@ public class CompositeADTabbox extends AbstractADTabbox Row row = gtr.getCurrentRow(); if (row != null) 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() {