if(user.getId() > 0) {
hide.setVisible(false);
}
add(hide);
// password ========================================================
final PasswordTextField passwordField = new PasswordTextField("password");
add(passwordField);
passwordField.setRequired(false);
// confirm password ================================================
final PasswordTextField confirmPasswordField = new PasswordTextField("passwordConfirm");
confirmPasswordField.setRequired(false);
confirmPasswordField.add(new ErrorHighlighter());
add(confirmPasswordField);
// validation, do the passwords match
add(new AbstractFormValidator() {
public FormComponent[] getDependentFormComponents() {
return new FormComponent[] {passwordField, confirmPasswordField};
}
public void validate(Form form) {
String a = (String) passwordField.getConvertedInput();
String b = (String) confirmPasswordField.getConvertedInput();
if((a != null && !a.equals(b)) || (b!= null && !b.equals(a))) {
confirmPasswordField.error(localize("user_form.passwordConfirm.error"));
}
}
});
// send notifications ==============================================
WebMarkupContainer hideSendNotifications = new WebMarkupContainer("hideSendNotifications");