From b6ede5ee217d2c61506de6caeb33da489faedd05 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 2 Dec 2014 17:36:10 -0500 Subject: [PATCH] IDEMPIERE-2346 Error CSV Exporting Broadcast Message / enable Import button when New is enabled --- .../src/org/adempiere/webui/adwindow/ADWindowToolbar.java | 6 +++++- .../adempiere/webui/adwindow/AbstractADWindowContent.java | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java index a9c07fa61f..d45793a28d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java @@ -72,7 +72,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener /** * */ - private static final long serialVersionUID = -5540268492066600133L; + private static final long serialVersionUID = -9183846974546235806L; public static final String BTNPREFIX = "Btn"; @@ -476,6 +476,10 @@ public class ADWindowToolbar extends FToolbar implements EventListener return !btnDelete.isDisabled(); } + public boolean isNewEnabled() { + return !btnNew.isDisabled(); + } + public void enableIgnore(boolean enabled) { this.btnIgnore.setDisabled(!enabled); 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 fd8fd2a64c..4cc8dc70f3 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 @@ -1279,7 +1279,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !adTabbox.getSelectedGridTab().isNew()); - toolbar.enableCSVImport(adTabbox.getSelectedGridTab().hasTemplate()); //Deepak-Enabling customize button IDEMPIERE-364 if(!(adTabbox.getSelectedTabpanel() instanceof ADSortTab)) @@ -1623,7 +1622,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !isNewRow); toolbar.enableReport(!isNewRow); toolbar.enableExport(!isNewRow && !adTabbox.getSelectedGridTab().isSortTab()); - toolbar.enableFileImport(!isNewRow && !changed && !adTabbox.getSelectedGridTab().isSortTab() && adTabbox.getSelectedGridTab().isInsertRecord()); + toolbar.enableFileImport(toolbar.isNewEnabled()); + toolbar.enableCSVImport(toolbar.isNewEnabled() && adTabbox.getSelectedGridTab().hasTemplate()); toolbar.enableTabNavigation(breadCrumb.hasParentLink(), adTabbox.getSelectedDetailADTabpanel() != null);