From d541bb4b4941d775a997a84563159c3cbf16b669 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 24 Nov 2009 08:02:59 +0000 Subject: [PATCH] http://sourceforge.net/tracker/?func=detail&aid=2899730&group_id=176962&atid=955896 - allow the use of enter key to accept user changes --- .../src/org/adempiere/webui/editor/WAccountEditor.java | 4 ++-- .../WEB-INF/src/org/adempiere/webui/editor/WDateEditor.java | 4 ++-- .../src/org/adempiere/webui/editor/WDatetimeEditor.java | 4 ++-- .../src/org/adempiere/webui/editor/WFileDirectoryEditor.java | 4 ++-- .../src/org/adempiere/webui/editor/WFilenameEditor.java | 4 ++-- .../WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java | 4 ++-- .../src/org/adempiere/webui/editor/WPAttributeEditor.java | 4 ++-- .../WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java | 4 ++-- .../WEB-INF/src/org/adempiere/webui/editor/WTimeEditor.java | 4 ++-- .../WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WAccountEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WAccountEditor.java index 81b66654e2..4b2c1529b6 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WAccountEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WAccountEditor.java @@ -39,7 +39,7 @@ import org.zkoss.zk.ui.event.Events; */ public class WAccountEditor extends WEditor implements ContextMenuListener { - private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE}; + private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE, Events.ON_OK}; private MAccountLookup m_mAccount; @@ -183,7 +183,7 @@ public class WAccountEditor extends WEditor implements ContextMenuListener public void onEvent(Event event) { - if (Events.ON_CHANGE.equals(event.getName())) + if (Events.ON_CHANGE.equals(event.getName()) || Events.ON_OK.equals(event.getName())) { cmd_text(); } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WDateEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WDateEditor.java index c1b8a457cf..367cac088c 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WDateEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WDateEditor.java @@ -41,7 +41,7 @@ import org.zkoss.zk.ui.event.Events; */ public class WDateEditor extends WEditor implements ContextMenuListener { - private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE}; + private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE, Events.ON_OK}; @SuppressWarnings("unused") private static final CLogger logger; @@ -118,7 +118,7 @@ public class WDateEditor extends WEditor implements ContextMenuListener public void onEvent(Event event) { - if (Events.ON_CHANGE.equalsIgnoreCase(event.getName())) + if (Events.ON_CHANGE.equalsIgnoreCase(event.getName()) || Events.ON_OK.equalsIgnoreCase(event.getName())) { Date date = getComponent().getValue(); Timestamp newValue = null; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WDatetimeEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WDatetimeEditor.java index 3291d89f0c..77ede77100 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WDatetimeEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WDatetimeEditor.java @@ -32,7 +32,7 @@ import org.zkoss.zk.ui.event.Events; */ public class WDatetimeEditor extends WEditor implements ContextMenuListener { - private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE}; + private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE, Events.ON_OK}; @SuppressWarnings("unused") private static final CLogger logger; @@ -110,7 +110,7 @@ public class WDatetimeEditor extends WEditor implements ContextMenuListener public void onEvent(Event event) { - if (Events.ON_CHANGE.equalsIgnoreCase(event.getName())) + if (Events.ON_CHANGE.equalsIgnoreCase(event.getName()) || Events.ON_OK.equalsIgnoreCase(event.getName())) { Date date = getComponent().getValue(); Timestamp newValue = null; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WFileDirectoryEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WFileDirectoryEditor.java index d3c25a8a09..97748fe79e 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WFileDirectoryEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WFileDirectoryEditor.java @@ -29,7 +29,7 @@ import org.zkoss.zk.ui.event.Events; */ public class WFileDirectoryEditor extends WEditor { - private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE}; + private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE, Events.ON_OK}; private static final CLogger log = CLogger.getCLogger(WFileDirectoryEditor.class); @@ -87,7 +87,7 @@ public class WFileDirectoryEditor extends WEditor public void onEvent(Event event) { - if (Events.ON_CHANGE.equals(event.getName())) + if (Events.ON_CHANGE.equals(event.getName()) || Events.ON_OK.equals(event.getName())) { String newValue = getComponent().getText(); if (oldValue != null && newValue != null && oldValue.equals(newValue)) { diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WFilenameEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WFilenameEditor.java index f20d6e8c3e..a1c6d8de15 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WFilenameEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WFilenameEditor.java @@ -37,7 +37,7 @@ import org.zkoss.zul.Fileupload; */ public class WFilenameEditor extends WEditor { - private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE}; + private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE, Events.ON_OK}; private static final CLogger log = CLogger.getCLogger(WFilenameEditor.class); @@ -95,7 +95,7 @@ public class WFilenameEditor extends WEditor public void onEvent(Event event) { - if (Events.ON_CHANGE.equals(event.getName())) + if (Events.ON_CHANGE.equals(event.getName()) || Events.ON_OK.equals(event.getName())) { String newValue = getComponent().getText(); if (oldValue != null && newValue != null && oldValue.equals(newValue)) { diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java index 95ecc6ccad..a05b4bffa7 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java @@ -44,7 +44,7 @@ import org.zkoss.zk.ui.event.Events; */ public class WNumberEditor extends WEditor implements ContextMenuListener { - public static final String[] LISTENER_EVENTS = {Events.ON_CHANGE}; + public static final String[] LISTENER_EVENTS = {Events.ON_CHANGE, Events.ON_OK}; public static final int MAX_DISPLAY_LENGTH = 20; @@ -129,7 +129,7 @@ public class WNumberEditor extends WEditor implements ContextMenuListener */ public void onEvent(Event event) { - if (Events.ON_CHANGE.equalsIgnoreCase(event.getName())) + if (Events.ON_CHANGE.equalsIgnoreCase(event.getName()) || Events.ON_OK.equalsIgnoreCase(event.getName())) { BigDecimal newValue = getComponent().getValue(); if (oldValue != null && newValue != null && oldValue.equals(newValue)) { diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java index b65a6a9bca..3a55c4b251 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java @@ -39,7 +39,7 @@ import org.zkoss.zk.ui.event.Events; */ public class WPAttributeEditor extends WEditor implements ContextMenuListener { - private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE}; + private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE, Events.ON_OK}; private static final CLogger log = CLogger.getCLogger(WPAttributeEditor.class); @@ -126,7 +126,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener public void onEvent(Event event) { - if (Events.ON_CHANGE.equals(event.getName())) + if (Events.ON_CHANGE.equals(event.getName()) || Events.ON_OK.equals(event.getName())) { String newText = getComponent().getText(); String oldText = null; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java index bc39a4a137..679a6760dd 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java @@ -48,7 +48,7 @@ public class WStringEditor extends WEditor implements ContextMenuListener { private static final String EDITOR_EVENT = "EDITOR"; - private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE}; + private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE, Events.ON_OK}; private String oldValue; @@ -168,7 +168,7 @@ public class WStringEditor extends WEditor implements ContextMenuListener public void onEvent(Event event) { - if (Events.ON_CHANGE.equals(event.getName())) + if (Events.ON_CHANGE.equals(event.getName()) || Events.ON_OK.equals(event.getName())) { String newValue = getComponent().getValue(); if (oldValue != null && newValue != null && oldValue.equals(newValue)) { diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WTimeEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WTimeEditor.java index d0490cf8f3..bee5651ae8 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WTimeEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WTimeEditor.java @@ -33,7 +33,7 @@ import org.zkoss.zul.Timebox; */ public class WTimeEditor extends WEditor implements ContextMenuListener { - private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE}; + private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE, Events.ON_OK}; private static final CLogger logger; static @@ -109,7 +109,7 @@ public class WTimeEditor extends WEditor implements ContextMenuListener public void onEvent(Event event) { - if (Events.ON_CHANGE.equalsIgnoreCase(event.getName())) + if (Events.ON_CHANGE.equalsIgnoreCase(event.getName()) || Events.ON_OK.equalsIgnoreCase(event.getName())) { Date date = getComponent().getValue(); Timestamp newValue = null; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java index 1501277c4d..f98262dfac 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java @@ -30,7 +30,7 @@ import org.zkoss.zk.ui.event.Events; public class WUrlEditor extends WEditor implements ContextMenuListener { - private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE}; + private static final String[] LISTENER_EVENTS = {Events.ON_CLICK, Events.ON_CHANGE, Events.ON_OK}; private String oldValue; private WEditorPopupMenu popupMenu; @@ -96,7 +96,7 @@ public class WUrlEditor extends WEditor implements ContextMenuListener public void onEvent(Event event) { - if (Events.ON_CHANGE.equals(event.getName())) + if (Events.ON_CHANGE.equals(event.getName()) || Events.ON_OK.equals(event.getName())) { String newValue = getComponent().getText(); if (oldValue != null && newValue != null && oldValue.equals(newValue)) {