Java Code Examples for play.data.Form#hasGlobalErrors()
The following examples show how to use
play.data.Form#hasGlobalErrors() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemShortAnswerConfAdapter.java From judgels with GNU General Public License v2.0 | 5 votes |
@Override public Form bindFormFromRequest(Http.Request request) { Form form = Form.form(ItemShortAnswerConfForm.class).bindFromRequest(); if (!(form.hasErrors() || form.hasGlobalErrors())) { ItemShortAnswerConfForm confForm = ((Form<ItemShortAnswerConfForm>) form).get(); if (!isRegexValid(confForm.inputValidationRegex)) { form.reject(Messages.get("error.problem.bundle.item.shortAnswer.invalidInputValidationRegex")); } if (!confForm.gradingRegex.isEmpty() && !isRegexValid(confForm.gradingRegex)) { form.reject(Messages.get("error.problem.bundle.item.shortAnswer.invalidGradingRegex")); } } return form; }
Example 2
Source File: ItemMultipleChoiceConfAdapter.java From judgels with GNU General Public License v2.0 | 5 votes |
@Override public Form bindFormFromRequest(Http.Request request) { Form form = Form.form(ItemMultipleChoiceConfForm.class).bindFromRequest(); if (!(form.hasErrors() || form.hasGlobalErrors())) { ItemMultipleChoiceConfForm confForm = ((Form<ItemMultipleChoiceConfForm>) form).get(); Set<String> uniqueChoiceAliases = Sets.newHashSet(confForm.choiceAliases); if (uniqueChoiceAliases.size() != confForm.choiceAliases.size()) { form.reject(Messages.get("error.problem.bundle.item.multipleChoice.duplicateAlias")); } } return form; }
Example 3
Source File: AbstractJudgelsController.java From judgels with GNU General Public License v2.0 | 4 votes |
protected static boolean formHasErrors(Form form) { return form.hasErrors() || form.hasGlobalErrors(); }