Skip to content

Commit

Permalink
fix for component form validation in vertical form
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Mar 31, 2023
1 parent 2035c3d commit 738c2a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ protected boolean alwaysReload() {
return true;
}
};
panel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
return panel;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import com.evolveum.midpoint.web.component.message.FeedbackAlerts;
import com.evolveum.midpoint.web.component.prism.InputPanel;

import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxEventBehavior;
Expand Down Expand Up @@ -44,7 +46,7 @@ protected void onInitialize() {
}
return "";
}));
baseFormComponent.add(new AjaxFormComponentUpdatingBehavior("blur") {
baseFormComponent.add(new AjaxFormComponentUpdatingBehavior("change") {

private boolean lastValidationWasError = false;

Expand All @@ -63,6 +65,7 @@ protected void onUpdate(AjaxRequestTarget target) {
if (lastValidationWasError) {
lastValidationWasError = false;
updateFeedbackPanel(target);
target.focusComponent(null);
}
}

Expand All @@ -71,6 +74,7 @@ protected void onError(AjaxRequestTarget target, RuntimeException e) {
updateFeedbackPanel(target);
}
});
// baseFormComponent.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
}
}

Expand Down

0 comments on commit 738c2a9

Please sign in to comment.