protected void createDepartmentInput(Form<T> form) { Fragment f = new Fragment("dept", "department", this); DropDownChoice<UserDepartment> userDepartment = new DropDownChoice<UserDepartment>( "user.userDepartment", getUserDepartments(), new ChoiceRenderer<UserDepartment>("name")); userDepartment.setRequired(true); userDepartment.setLabel(new ResourceModel("admin.user.department")); userDepartment.add(new ValidatingFormComponentAjaxBehavior()); f.add(userDepartment); f.add(new AjaxFormComponentFeedbackIndicator("departmentValidationError", userDepartment)); form.add(f); }