Commit 4115ff44 authored by Dominik Kozubík's avatar Dominik Kozubík
Browse files

add required param

parent 32d85361
Pipeline #141722 passed with stage
in 1 minute and 28 seconds
......@@ -82,10 +82,13 @@ public class MatchController {
Model model, RedirectAttributes redirectAttributes, UriComponentsBuilder uriBuilder) {
//in case of validation error forward back to the the form
if (bindingResult.hasErrors()) {
System.err.println("tu som 0");
return "match/new";
}
//create tournament
System.err.println("tu som 1");
String uuid = matchFacade.createMatch(formBean);
System.err.println("tu som 2");
//report success
redirectAttributes.addFlashAttribute("alert_success", "Match " + uuid + " was created");
return "redirect:" + uriBuilder.path("/match/view/{id}").buildAndExpand(uuid).encode().toUriString();
......
......@@ -13,7 +13,7 @@
<div class="form-group">
<form:label path="tournament" cssClass="col-sm-2 control-label">Tournament</form:label>
<div class="col-sm-10">
<form:select path="tournament" cssClass="form-control">
<form:select path="tournament" required="required" cssClass="form-control">
<c:forEach items="${tournaments}" var="tournament">
<form:option value="${tournament.id}">${tournament.id}</form:option>
</c:forEach>
......@@ -24,7 +24,7 @@
<div class="form-group">
<form:label path="teams" cssClass="col-sm-2 control-label">Team</form:label>
<div class="col-sm-10">
<form:select path="teams" cssClass="form-control">
<form:select path="teams" required="required" cssClass="form-control">
<c:forEach items="${teams}" var="team">
<form:option value="${team.name}">${team.name}</form:option>
</c:forEach>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment