add(new StudentFlagPanel("studentFlagPanel", mUser.getObject(), flagMap).setVisible(!newStudent));
TextField<String> lastName = new TextField<String>("lastName", new PropertyModel<String>(mUser, "lastName"));
lastName.setRequired(true);
lastName.add(new SimpleAttributeModifier("maxlength", "32"));
add(lastName);
TextField<String> firstName = new TextField<String>("firstName", new PropertyModel<String>(mUser, "firstName"));
firstName.setRequired(true);
firstName.add(new SimpleAttributeModifier("maxlength", "32"));
add(firstName);
// E-mail Address
TextField<String> email = new TextField<String>("email", new PropertyModel<String>(mUser, "email"));
email.add(EmailAddressValidator.getInstance());
email.add(new UniqueUserFieldValidator(mUser, Field.EMAIL));
add(email);
TextField<String> userName = new TextField<String>("username", new PropertyModel<String>(mUser, "username"));
userName.add(new SimpleAttributeModifier("maxlength", "32"));
userName.setRequired(true);
userName.add(new UniqueUserFieldValidator(mUser, Field.USERNAME));
add(userName);
// RSAPasswordTextField does not seem to work well with Ajax
// TODO: Fix that
PasswordTextField password = new PasswordTextField("password", new Model<String>()) {
private static final long serialVersionUID = 1L;
@Override
public void updateModel() {
if (getConvertedInput() != null) {
((EditStudentForm) getForm()).getModelObject().setPassword(getConvertedInput());
}
setModelObject(null);
}
};
password.add(new SimpleAttributeModifier("maxlength", "32"));
password.setRequired(mUser.getObject().isTransient());
add(password);
add(new AjaxSubmitLink("save") {
private static final long serialVersionUID = 1L;