radioGroup.add(new Radio<Role>("teacher", new Model<Role>(Role.TEACHER), radioGroup));
radioGroup.add(new Radio<Role>("student", new Model<Role>(Role.STUDENT), radioGroup));
radioGroup.setRequired(true);
// this would be the standard portion of this
add(new FeedbackBorder("usernameBorder")
.add(new TextField<String>("username")
.add(StringValidator.lengthBetween(6, 32))
.add(new PatternValidator("[\\w-.]+"))
.add(new UniqueUserFieldValidator(Field.USERNAME))
.setRequired(true)));
add(new FeedbackBorder("firstnameBorder")
.add(new TextField<String>("firstName")
.add(StringValidator.maximumLength(32))
.setRequired(false)));
add(new FeedbackBorder("lastnameBorder")
.add(new TextField<String>("lastName")
.add(StringValidator.maximumLength(32))
.setRequired(false)));
add(new FeedbackBorder("emailBorder")
.add(email = (TextField<String>) new TextField<String>("email")
.add(EmailAddressValidator.getInstance())
.add(StringValidator.maximumLength(255))
.add(new UniqueUserFieldValidator(Field.EMAIL))
.setRequired(true)));
add(new FeedbackBorder("verifyEmailBorder")
.add(verifyEmail = (TextField<String>) new TextField<String>("verifyEmail", new Model<String>())
.setRequired(true)));
add(new FeedbackBorder("passwordBorder")
.add(password = (PasswordTextField) new PasswordTextField("password", new Model<String>())
.add(StringValidator.lengthBetween(4, 32))
.add(new PatternValidator("[\\w!@#$%^&*()-=_+\\\\.,;:/]+"))
.setRequired(true)));
add(new FeedbackBorder("verifyPasswordBorder")
.add(verifyPassword = (PasswordTextField) new PasswordTextField("verifyPassword", new Model<String>())
.setRequired(true)));
// Passwords and email addresses have to match
add(new EqualPasswordConvertedInputValidator(password, verifyPassword));