new PropertyModel<String>(userTO, "username"));
final WebMarkupContainer jexlHelp = JexlHelpUtil.getJexlHelpWebContainer("usernameJexlHelp");
add(jexlHelp);
final AjaxLink questionMarkJexlHelp = JexlHelpUtil.getAjaxLink(jexlHelp, "usernameQuestionMarkJexlHelp");
add(questionMarkJexlHelp);
if (!templateMode) {
username.addRequiredLabel();
questionMarkJexlHelp.setVisible(false);
}
add(username);
// ------------------------
// ------------------------
// Password
// ------------------------
FieldPanel<String> password;
Label confirmPasswordLabel = new Label("confirmPasswordLabel", new ResourceModel("confirmPassword"));
FieldPanel<String> confirmPassword;
final WebMarkupContainer pwdJexlHelp = JexlHelpUtil.getJexlHelpWebContainer("pwdJexlHelp");
add(pwdJexlHelp);
final AjaxLink pwdQuestionMarkJexlHelp = JexlHelpUtil.getAjaxLink(pwdJexlHelp, "pwdQuestionMarkJexlHelp");
add(pwdQuestionMarkJexlHelp);
if (templateMode) {
password = new AjaxTextFieldPanel("password", "password", new PropertyModel<String>(userTO, "password"));
confirmPasswordLabel.setVisible(false);
confirmPassword = new AjaxTextFieldPanel("confirmPassword", "confirmPassword", new Model<String>());
confirmPassword.setEnabled(false);
confirmPassword.setVisible(false);
} else {
pwdQuestionMarkJexlHelp.setVisible(false);
password = new AjaxPasswordFieldPanel("password", "password",
new PropertyModel<String>(userTO, "password"));
password.setRequired(userTO.getId() == 0);
((PasswordTextField) password.getField()).setResetPassword(resetPassword);