syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] git commit: [SYNCOPE-567] Applying provided patch
Date Fri, 17 Oct 2014 10:08:14 GMT
Repository: syncope
Updated Branches:
  refs/heads/master a46b22c4a -> 14b8988ed


[SYNCOPE-567] Applying provided patch


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/f99657a2
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/f99657a2
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/f99657a2

Branch: refs/heads/master
Commit: f99657a2a66abfd68c115d9c1b083dc9b86a3105
Parents: 9cddacd
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri Oct 17 12:07:50 2014 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Oct 17 12:07:50 2014 +0200

----------------------------------------------------------------------
 .../console/pages/RequestPasswordResetModalPage.java        | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/f99657a2/console/src/main/java/org/apache/syncope/console/pages/RequestPasswordResetModalPage.java
----------------------------------------------------------------------
diff --git a/console/src/main/java/org/apache/syncope/console/pages/RequestPasswordResetModalPage.java
b/console/src/main/java/org/apache/syncope/console/pages/RequestPasswordResetModalPage.java
index 165f3de..84d82ec 100644
--- a/console/src/main/java/org/apache/syncope/console/pages/RequestPasswordResetModalPage.java
+++ b/console/src/main/java/org/apache/syncope/console/pages/RequestPasswordResetModalPage.java
@@ -69,20 +69,24 @@ public class RequestPasswordResetModalPage extends BaseModalPage {
         username.setRequired(true);
         username.getField().setOutputMarkupId(true);
         if (handleSecurityQuestion) {
-            username.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE)
{
+            username.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR)
{
 
                 private static final long serialVersionUID = -1107858522700306810L;
 
                 @Override
                 protected void onUpdate(final AjaxRequestTarget target) {
+                    getFeedbackMessages().clear();
+                    target.add(feedbackPanel);
                     try {
                         SecurityQuestionTO read = securityQuestionRestClient.readByUser(username.getModelObject());
                         securityQuestion.setModelObject(read.getContent());
-                        target.add(securityQuestion);
                     } catch (Exception e) {
                         LOG.error("While fetching security question for {}", username.getModelObject(),
e);
                         error(getString(Constants.ERROR) + ": " + e.getMessage());
                         feedbackPanel.refresh(target);
+                        securityQuestion.setModelObject(null);
+                    } finally {
+                        target.add(securityQuestion);
                     }
                 }
             });
@@ -137,6 +141,7 @@ public class RequestPasswordResetModalPage extends BaseModalPage {
 
             @Override
             protected void onError(final AjaxRequestTarget target, final Form<?> form)
{
+                // do nothing
             }
         };
         cancel.setDefaultFormProcessing(false);


Mime
View raw message