diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 7b2bcd9284..5eaaca78cf 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -1226,18 +1226,20 @@ DataStatusListener, IADTabpanel, IdSpace @Override public void setDetailPaneMode(boolean detailPaneMode) { - this.detailPaneMode = detailPaneMode; - if (detailPaneMode) { - detailPane = null; - if (formContainer instanceof Borderlayout) { - Borderlayout borderLayout = (Borderlayout) formContainer; - if (borderLayout.getSouth() != null) { - borderLayout.getSouth().detach(); + if (this.detailPaneMode != detailPaneMode) { + this.detailPaneMode = detailPaneMode; + if (detailPaneMode) { + detailPane = null; + if (formContainer instanceof Borderlayout) { + Borderlayout borderLayout = (Borderlayout) formContainer; + if (borderLayout.getSouth() != null) { + borderLayout.getSouth().detach(); + } } - } - } - this.setVflex("true"); - listPanel.setDetailPaneMode(detailPaneMode); + } + this.setVflex("true"); + listPanel.setDetailPaneMode(detailPaneMode); + } } /** 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 bfb377cb56..fe536564e2 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 @@ -1399,7 +1399,10 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } // - adTabbox.evaluate(e); + if (!detailTab) + { + adTabbox.evaluate(e); + } toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted()); toolbar.enableReport(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 894cc19f8d..3065122612 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 @@ -318,11 +318,13 @@ public class CompositeADTabbox extends AbstractADTabbox private void activateDetailADTabpanel() { if (detailPane != null && detailPane.getParent() != null) { - IADTabpanel tabPanel = detailPane.getSelectedADTabpanel(); - tabPanel.activate(true); - if (!tabPanel.isGridView()) { - tabPanel.switchRowPresentation(); - } + IADTabpanel tabPanel = detailPane.getSelectedADTabpanel(); + if (tabPanel != null) { + tabPanel.activate(true); + if (!tabPanel.isGridView()) { + tabPanel.switchRowPresentation(); + } + } } } @@ -516,28 +518,29 @@ public class CompositeADTabbox extends AbstractADTabbox } IADTabpanel detailTab = detailPane.getSelectedADTabpanel(); - - //check data action - String uuid = (String) execution.getAttribute(CompositeADTabbox.class.getName()+".dataAction"); - if (uuid != null && uuid.equals(detailTab.getUuid())) { - //refresh current row - detailTab.getGridTab().dataRefresh(false); - //keep focus - Clients.scrollIntoView(detailTab); - - return; - } - - GridTab tab = detailTab.getGridTab(); - GridField[] fields = tab.getFields(); - for (GridField field : fields) - { - if (!parentColumnNames.contains(field.getColumnName())) - Env.setContext(Env.getCtx(), field.getWindowNo(), field.getColumnName(), ""); - } - detailTab.activate(true); - detailTab.setDetailPaneMode(true); - detailPane.setVflex("true"); + if (detailTab != null) { + //check data action + String uuid = (String) execution.getAttribute(CompositeADTabbox.class.getName()+".dataAction"); + if (uuid != null && uuid.equals(detailTab.getUuid())) { + //refresh current row + detailTab.getGridTab().dataRefresh(false); + //keep focus + Clients.scrollIntoView(detailTab); + + return; + } + + GridTab tab = detailTab.getGridTab(); + GridField[] fields = tab.getFields(); + for (GridField field : fields) + { + if (!parentColumnNames.contains(field.getColumnName())) + Env.setContext(Env.getCtx(), field.getWindowNo(), field.getColumnName(), ""); + } + detailTab.activate(true); + detailTab.setDetailPaneMode(true); + } + detailPane.setVflex("true"); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java index 0eb12369fd..3b8422be83 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java @@ -537,8 +537,12 @@ public class DetailPane extends Panel implements EventListener, IdSpace { Tab tab = (Tab) tabbox.getTabs().getChildren().get(i); tab.setVisible(visible); - if (tab.getLinkedPanel() != null) + if (tab.isSelected()) { + tab.setSelected(false); + } + if (tab.getLinkedPanel() != null) { tab.getLinkedPanel().setVisible(visible); + } } public boolean isTabVisible(int i) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java index f89c2ff041..c8a6d4353b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java @@ -167,9 +167,11 @@ public class GridView extends Vbox implements EventListener, IdSpace } public void setDetailPaneMode(boolean detailPaneMode) { - this.detailPaneMode = detailPaneMode; - pageSize = detailPaneMode ? DEFAULT_DETAIL_PAGE_SIZE : MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 20); - updatePaging(); + if (this.detailPaneMode != detailPaneMode) { + this.detailPaneMode = detailPaneMode; + pageSize = detailPaneMode ? DEFAULT_DETAIL_PAGE_SIZE : MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 20); + updatePaging(); + } } public boolean isDetailPaneMode() { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Tabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Tabpanel.java index ae7da6661b..793672eaf7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Tabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Tabpanel.java @@ -45,7 +45,19 @@ public class Tabpanel extends org.zkoss.zul.Tabpanel implements IdSpace return enabled; } - public void setEnabled(boolean enabled) + @Override + public boolean setVisible(boolean visible) { + // TODO Auto-generated method stub + return super.setVisible(visible); + } + + @Override + protected void setVisibleDirectly(boolean visible) { + // TODO Auto-generated method stub + super.setVisibleDirectly(visible); + } + + public void setEnabled(boolean enabled) { this.enabled = enabled; }