Skip to content

Commit

Permalink
fix for MID-9333 GUI Credentials-Password trims whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Nov 24, 2023
1 parent b7e18e8 commit bbe23e7
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public class PasswordPanel extends InputPanel {
private final IModel<ProtectedStringType> model;

private boolean isReadOnly;
private boolean shouldTrimInput = false;


public PasswordPanel(String id, IModel<ProtectedStringType> model) {
this(id, model, false, model == null || model.getObject() == null);
Expand Down Expand Up @@ -143,14 +145,27 @@ protected void onComponentTag(ComponentTag tag) {
}
}

@Override
protected boolean shouldTrimInput() {
return shouldTrimInput;
}
};
password1.add(AttributeAppender.append("onfocus", initPasswordValidation()));
password1.setRequired(false);
password1.setOutputMarkupId(true);
password1.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
inputContainer.add(password1);

final PasswordTextField password2 = new SecureModelPasswordTextField(ID_PASSWORD_TWO, new PasswordModel(Model.of(new ProtectedStringType())));
final PasswordTextField password2 = new SecureModelPasswordTextField(ID_PASSWORD_TWO,
new PasswordModel(Model.of(new ProtectedStringType()))) {

private static final long serialVersionUID = 1L;

@Override
protected boolean shouldTrimInput() {
return shouldTrimInput;
}
};
password2.setRequired(false);
password2.setOutputMarkupId(true);
inputContainer.add(password2);
Expand Down

0 comments on commit bbe23e7

Please sign in to comment.