DataSourceTextField ldapField = createBooleanField(Field.LDAP, MSG.dataSource_users_field_ldap(), true);
ldapField.setCanEdit(false); // read-only
fields.add(ldapField);
DataSourcePasswordField passwordField = new DataSourcePasswordField(Field.PASSWORD,
MSG.common_title_password(), 100, true);
LengthRangeValidator passwordValidator = new LengthRangeValidator();
passwordValidator.setMin(6);
passwordValidator.setMax(100);
passwordField.setValidators(passwordValidator);
fields.add(passwordField);
DataSourcePasswordField passwordVerifyField = new DataSourcePasswordField(Field.PASSWORD_VERIFY,
MSG.dataSource_users_field_passwordVerify(), 100, true);
MatchesFieldValidator passwordsEqualValidator = new MatchesFieldValidator();
passwordsEqualValidator.setOtherField(Field.PASSWORD);
passwordsEqualValidator.setErrorMessage(MSG.dataSource_users_passwordsDoNotMatch());
passwordVerifyField.setValidators(passwordsEqualValidator);
fields.add(passwordVerifyField);
DataSourceTextField firstNameField = createTextField(Field.FIRST_NAME, MSG.dataSource_users_field_firstName(),
null, 100, true);
fields.add(firstNameField);