diff --git a/org.adempiere.base/src/org/compiere/model/GridWindow.java b/org.adempiere.base/src/org/compiere/model/GridWindow.java index 5a77b3e52b..6e75187b52 100644 --- a/org.adempiere.base/src/org/compiere/model/GridWindow.java +++ b/org.adempiere.base/src/org/compiere/model/GridWindow.java @@ -204,14 +204,22 @@ public class GridWindow implements Serializable mTab.setLinkColumnName((String)parents.get(0)); else { + GridTab parentTab = null; // More than one parent. // Search prior tabs for the "right parent" // for all previous tabs for (int i = 0; i < index; i++) + { + if (m_tabs.get(i).getTabLevel() + 1 == mTab.getTabLevel()) { + parentTab = m_tabs.get(i); + break; + } + } + + if (parentTab != null) { // we have a tab - GridTab tab = (GridTab)m_tabs.get(i); - String tabKey = tab.getKeyColumnName(); // may be "" + String tabKey = parentTab.getKeyColumnName(); // may be "" // look, if one of our parents is the key of that tab for (int j = 0; j < parents.size(); j++) { @@ -223,8 +231,8 @@ public class GridWindow implements Serializable } // The tab could have more than one key, look into their parents if (tabKey.equals("")) - for (int k = 0; k < tab.getParentColumnNames().size(); k++) - if (parent.equals(tab.getParentColumnNames().get(k))) + for (int k = 0; k < parentTab.getParentColumnNames().size(); k++) + if (parent.equals(parentTab.getParentColumnNames().get(k))) { mTab.setLinkColumnName(parent); break; 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 8432cf5518..af7c6d976f 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 @@ -571,6 +571,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements private void initFirstTabpanel() { adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); adTabbox.getSelectedTabpanel().activate(true); + Events.echoEvent(new Event("onPostInit", adTabbox.getComponent())); } /** 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 c2610c5850..dd0babc2ef 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 @@ -188,6 +188,13 @@ public class CompositeADTabbox extends AbstractADTabbox } }); + layout.addEventListener("onPostInit", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + layout.invalidate(); + } + }); + return layout; } @@ -303,7 +310,6 @@ public class CompositeADTabbox extends AbstractADTabbox } else tabPanel.setVisible(false); detailPane.setHflex("1"); - detailPane.setStyle("min-height: 200px; overflow-y: visible;"); detailPane.addADTabpanel(tabPanel, tabLabel); tabPanel.setDetailPaneMode(true, isUseVflexForDetailPane()); detailPane.setVflex(Boolean.toString(isUseVflexForDetailPane())); @@ -542,7 +548,7 @@ public class CompositeADTabbox extends AbstractADTabbox detailTab.setDetailPaneMode(true, isUseVflexForDetailPane()); detailPane.setVflex(Boolean.toString(isUseVflexForDetailPane())); if (!ADTabpanel.isUseSplitViewForForm()) { - detailPane.invalidate(); + layout.invalidate(); } } } @@ -645,6 +651,9 @@ public class CompositeADTabbox extends AbstractADTabbox detailPane.updateToolbar(false, true); } else { tabPanel.dynamicDisplay(0); + if (!ADTabpanel.isUseSplitViewForForm() && !headerTab.isGridView()) { + detailPane.invalidate(); + } } } 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 b3de44f2ee..63646977bc 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 @@ -91,14 +91,22 @@ public class DetailPane extends Panel implements EventListener { @Override public void onEvent(Event event) throws Exception { fireActivateDetailEvent(); + if (!ADTabpanel.isUseSplitViewForForm()) { + Clients.scrollIntoView(getSelectedADTabpanel()); + } } }); tabbox.setSclass("adwindow-detailpane-tabbox"); + if (!ADTabpanel.isUseSplitViewForForm()) { + LayoutUtils.addSclass("adwindow-detailpane-tabbox-xsplit", tabbox); + } createPopup(); this.setSclass("adwindow-detailpane"); - + if (!ADTabpanel.isUseSplitViewForForm()) { + LayoutUtils.addSclass("adwindow-detailpane-xsplit", this); + } } public int getSelectedIndex() { diff --git a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp index 23c1c50ba2..8b67b7c6cf 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -506,7 +506,12 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { } .adwindow-detailpane { - min-height: 200px; width: 100%; overflow-y: visible; + width: 100%; + overflow-y: visible; +} + +.adwindow-detailpane-xsplit { + min-height: 200px; } .adwindow-detailpane-tabpanel { @@ -531,12 +536,17 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { } .adwindow-detailpane-tabbox { - min-height: 200px; width: 99%; margin: auto; + width: 99%; + margin: auto; background-color: #E4E4E4; } +.adwindow-detailpane-tabbox-xsplit .z-tabpanel { + min-height: 200px; +} + .adwindow-gridview-detail { - height: 250px; + height: 40%; } .adwindow-gridview-detail + .z-south-splt {