From 7d24e083c3b0bbd391582b69ce3b472d7fdbbf6a Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 31 Jan 2013 01:32:48 +0800 Subject: [PATCH] IDEMPIERE-369 Master Detail layout improvements. State of toolbar button sometime is wrong after save and ignore. --- .../webui/adwindow/AbstractADWindowContent.java | 16 ++++++++++++---- .../webui/adwindow/CompositeADTabbox.java | 5 ++++- 2 files changed, 16 insertions(+), 5 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 cb55c2c52f..d23329612b 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 @@ -1096,8 +1096,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements callback.onCallback(true); } } // there is a change - else + else { + // just in case + adTabbox.dataIgnore(); callback.onCallback(true); + } } else callback.onCallback(true); @@ -1224,7 +1227,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if (!detailTab) { String dbInfo = e.getMessage(); - logger.info(dbInfo); + if (logger.isLoggable(Level.INFO)) + logger.info(dbInfo); if (adTabbox.getSelectedGridTab() != null && adTabbox.getSelectedGridTab().isQueryActive()) dbInfo = "[ " + dbInfo + " ]"; breadCrumb.setStatusDB(dbInfo, e); @@ -1435,7 +1439,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements toolbar.enableReport(true); toolbar.enableExport(!adTabbox.getSelectedGridTab().isSortTab()); toolbar.enableFileImport(!changed && !adTabbox.getSelectedGridTab().isSortTab() && adTabbox.getSelectedGridTab().isInsertRecord()); - + + toolbar.enableTabNavigation(breadCrumb.hasParentLink(), adTabbox.getSelectedDetailADTabpanel() != null); + //Deepak-Enabling customize button IDEMPIERE-364 if(!(adTabbox.getSelectedTabpanel() instanceof ADSortTab)) toolbar.enableCustomize(((ADTabpanel)adTabbox.getSelectedTabpanel()).isGridView()); @@ -1680,7 +1686,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements adTabbox.dataIgnore(); toolbar.enableIgnore(false); if (newrecod) { - onRefresh(true); + onRefresh(true, false); } else if (dirtyTabpanel != null) { dirtyTabpanel.getGridTab().dataRefresh(true); // update statusbar & toolbar dirtyTabpanel.dynamicDisplay(0); @@ -1689,6 +1695,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } if (dirtyTabpanel != null) focusToTabpanel(dirtyTabpanel); + + updateToolbar(); } /** 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 32aa03edc6..3e7cbff4ce 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 @@ -610,7 +610,10 @@ public class CompositeADTabbox extends AbstractADTabbox public void onDetailRecord() { if (headerTab.getDetailPane() != null && getSelectedDetailADTabpanel() != null) { try { - headerTab.getDetailPane().onEdit(false); + if (!getSelectedDetailADTabpanel().isActivated()) { + onActivateDetail(getSelectedDetailADTabpanel()); + } + headerTab.getDetailPane().onEdit(getSelectedDetailADTabpanel().getGridTab().isSingleRow()); } catch (Exception e) { log.log(Level.SEVERE, e.getLocalizedMessage(), e); }