From 4f8e31bdd3fbfd307c8f1a3f3dc69e64f257387d Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 18 Feb 2014 00:16:41 +0800 Subject: [PATCH] IDEMPIERE-1749 Add window event validator for AD_Window --- .../adempiere/webui/adwindow/AbstractADWindowContent.java | 2 +- .../webui/adwindow/validator/WindowValidatorManager.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 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 15f5df2531..f9c5c660c7 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 @@ -2392,7 +2392,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override public void onEvent(Event event) throws Exception { - postCallback.onCallback(dialog.isCancel()); + postCallback.onCallback(!dialog.isCancel()); } }); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/validator/WindowValidatorManager.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/validator/WindowValidatorManager.java index 268683ef09..759e17238a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/validator/WindowValidatorManager.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/validator/WindowValidatorManager.java @@ -28,15 +28,18 @@ public class WindowValidatorManager implements BundleActivator, ServiceTrackerCu ServiceReference reference) { WindowValidator service = context.getService(reference); String uuid = (String) reference.getProperty("AD_Window_UU"); - if (uuid == null || "*".equals(uuid)) + System.out.println("service="+service+" uuid="+uuid); + if (uuid == null || "*".equals(uuid)) { globalValidators.add(service); + return service; + } List list = validatorMap.get(uuid); if (list == null) { list = new ArrayList(); validatorMap.put(uuid, list); } - list.add(service); + list.add(service); return service; }