From 9bab16fbff644ddcb08f27fd7e3e6fdd753df2eb Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 12 Sep 2022 05:23:42 +0200 Subject: [PATCH] IDEMPIERE-5416 Alt+A is used for Create+New - for usability would be good to use it also for New (#1477) * IDEMPIERE-5416 Alt+A is used for Create+New - for usability would be good to use it also for New * Fix test case reported by Heng Sin --- .../src/org/adempiere/webui/adwindow/ADWindowToolbar.java | 3 ++- .../org/adempiere/webui/adwindow/AbstractADWindowContent.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 8d92e36c1f..3aea72b4f0 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 @@ -609,7 +609,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener public void enableSave(boolean enabled) { this.btnSave.setDisabled(!enabled); - this.btnSaveAndCreate.setDisabled(!enabled); + this.btnSaveAndCreate.setDisabled(!(isNewEnabled() || isSaveEnable())); } public boolean isSaveEnable() { @@ -643,6 +643,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener public void enableNew(boolean enabled) { this.btnNew.setDisabled(!enabled); + this.btnSaveAndCreate.setDisabled(!(isNewEnabled() || isSaveEnable())); } public void enableCopy(boolean 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 95b5012e64..bdb63ae9b0 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 @@ -2598,6 +2598,10 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if (!retValue) { + if (CLogger.peekError() == null && ! wasChanged && callback != null) { + callback.onCallback(true); + return; + } showLastError(); if (callback != null) callback.onCallback(false);