* Submits a user action.
*/
protected void onSubmit() {
try {
Applicants applicants = (Applicants) modelContext.getEntities();
Applicant applicant = (Applicant) modelContext.getEntity();
applicants.getErrors().empty();
if (applicants.add(applicant)) {
App app = viewContext.getApp();
EmailConfig emailConfig = app.getEmailConfig();
String applicantMessageStart = "...please copy the following confirmation number: ";
Long applicantConfirmationNumber = applicant.getOid()
.getUniqueNumber();
String applicantMessageFinish = ", and paste it in the Confirmation Number field of the Login page.";
applicant.emailMessage(emailConfig,
"To confirm your application...", applicantMessageStart
+ applicantConfirmationNumber
+ applicantMessageFinish);
setResponsePage(LoginPage.class);
} else {