From 45ede791a443b0a8c409c2ce00e77cbb55c4720f Mon Sep 17 00:00:00 2001 From: hieplq Date: Wed, 7 May 2014 22:27:23 +0800 Subject: [PATCH] IDEMPIERE-1935:in changepassword window, push "enter" key make waiting window never end --- .../adempiere/webui/panel/ResetPasswordPanel.java | 15 +++++++++++---- .../org/adempiere/webui/window/LoginWindow.java | 6 ++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index d7cfdc1c9b..20399406c6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -53,6 +53,7 @@ import org.zkoss.zhtml.Td; import org.zkoss.zhtml.Tr; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Image; /** @@ -314,10 +315,7 @@ public class ResetPasswordPanel extends Window implements EventListener { if (event.getTarget().getId().equals(ConfirmPanel.A_OK)) { - if (txtAnswer != null && txtAnswer.isReadonly()) - validateEmail(); - else - validateResetPassword(); + validate (); } else if (event.getTarget().getId().equals(ConfirmPanel.A_CANCEL)) { @@ -326,6 +324,15 @@ public class ResetPasswordPanel extends Window implements EventListener } } + public void validate (){ + Clients.clearBusy(); + + if (txtAnswer != null && txtAnswer.isReadonly()) + validateEmail(); + else + validateResetPassword(); + } + protected void validateEmail() { String email = txtEmail.getValue(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/LoginWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/LoginWindow.java index 261df9bf72..dbd925db7b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/LoginWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/LoginWindow.java @@ -168,6 +168,12 @@ public class LoginWindow extends FWindow implements EventListener changePasswordPanel.validateChangePassword(); return; } + + ResetPasswordPanel resetPasswordPanel = (ResetPasswordPanel)this.getFellowIfAny("resetPasswordPanel"); + if (resetPasswordPanel != null){ + resetPasswordPanel.validate(); + return; + } } }