Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Apr 5, 2023
2 parents 4a842fc + c79d70b commit 5d34d7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.markup.html.panel.Panel;
Expand Down Expand Up @@ -52,7 +53,12 @@ protected void onBeforeRender() {
}
return "";
}));
formComponent.add(new AjaxFormComponentUpdatingBehavior("blur") {

String event = "blur";
if (formComponent instanceof AutoCompleteTextField) {
event = "change";
}
formComponent.add(new AjaxFormComponentUpdatingBehavior(event) {

private boolean lastValidationWasError = false;

Expand All @@ -71,6 +77,7 @@ protected void onUpdate(AjaxRequestTarget target) {
if (lastValidationWasError) {
lastValidationWasError = false;
target.add(getComponent());
target.focusComponent(null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.evolveum.midpoint.web.component.input.validator.NotNullValidator;
import com.evolveum.midpoint.web.component.prism.InputPanel;
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour;
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import com.evolveum.prism.xml.ns._public.types_3.ItemPathType;

Expand Down Expand Up @@ -149,7 +148,6 @@ protected <C> IConverter<C> getAutoCompleteConverter(Class<C> type, IConverter<C
}
};
panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
panel.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
return panel;
}
}
Expand Down

0 comments on commit 5d34d7d

Please sign in to comment.