[SYNCOPE-1342] Missing onblur / onchage on domain and locale dropdown
authorFrancesco Chicchiriccò <ilgrosso@apache.org>
Mon, 23 Jul 2018 08:20:38 +0000 (10:20 +0200)
committerFrancesco Chicchiriccò <ilgrosso@apache.org>
Mon, 23 Jul 2018 08:20:51 +0000 (10:20 +0200)
client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java

index 796408e..488494d 100644 (file)
@@ -31,13 +31,13 @@ import org.apache.syncope.client.console.init.ConsoleInitializer;
 import org.apache.syncope.client.console.panels.NotificationPanel;
 import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
 import org.apache.wicket.ajax.markup.html.form.AjaxButton;
 import org.apache.wicket.authentication.IAuthenticationStrategy;
 import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.ChoiceRenderer;
-import org.apache.wicket.markup.html.form.DropDownChoice;
 import org.apache.wicket.markup.html.form.PasswordTextField;
 import org.apache.wicket.markup.html.form.StatelessForm;
 import org.apache.wicket.markup.html.form.TextField;
@@ -64,10 +64,6 @@ public class Login extends WebPage {
 
     private final TextField<String> passwordField;
 
-    private final DropDownChoice<Locale> languageSelect;
-
-    private final DropDownChoice<String> domainSelect;
-
     public Login(final PageParameters parameters) {
         super(parameters);
         setStatelessHint(true);
@@ -94,13 +90,47 @@ public class Login extends WebPage {
         passwordField.setMarkupId("password");
         form.add(passwordField);
 
-        languageSelect = new LocaleDropDown("language");
+        LocaleDropDown languageSelect = new LocaleDropDown("language");
+        languageSelect.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
+
+            private static final long serialVersionUID = -1107858522700306810L;
+
+            @Override
+            protected void onUpdate(final AjaxRequestTarget target) {
+                // nothing to do
+            }
+        }).add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+            private static final long serialVersionUID = -1107858522700306810L;
+
+            @Override
+            protected void onUpdate(final AjaxRequestTarget target) {
+                // nothing to do
+            }
+        });
         form.add(languageSelect);
 
-        domainSelect = new DomainDropDown("domain");
+        DomainDropDown domainSelect = new DomainDropDown("domain");
         if (SyncopeConsoleApplication.get().getDomains().size() == 1) {
             domainSelect.setOutputMarkupPlaceholderTag(true);
         }
+        domainSelect.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
+
+            private static final long serialVersionUID = -1107858522700306810L;
+
+            @Override
+            protected void onUpdate(final AjaxRequestTarget target) {
+                // nothing to do
+            }
+        }).add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+            private static final long serialVersionUID = -1107858522700306810L;
+
+            @Override
+            protected void onUpdate(final AjaxRequestTarget target) {
+                // nothing to do
+            }
+        });
         form.add(domainSelect);
 
         AjaxButton submitButton = new AjaxButton("submit", new Model<>(getString("submit"))) {