return "form";
}
- @RequestMapping(path = "/", params = "card=add")
+ @RequestMapping(path = "/", params = { "card=add", "!add", "!remove" })
public String addCard(@ModelAttribute Form form)
{
Integer next =
return "form";
}
- @RequestMapping(path = "/", params = "card!=add")
+ @RequestMapping(path = "/", params = { "card!=add", "!add", "!remove" })
public String removeCard(@ModelAttribute Form form, @RequestParam Integer card)
{
Map<String, Boolean> content = form.cards.remove(card);
return "form";
}
- @RequestMapping(path = "/", params = "add")
+ @RequestMapping(path = "/", params = { "!card", "add", "!remove" })
public String addRow(@ModelAttribute Form form, @RequestParam Integer add)
{
LOG.info("Adding row {} to card #{}", form.names.get(add), add);
return "form";
}
- @RequestMapping(path = "/", params = "remove")
+ @RequestMapping(path = "/", params = { "!card", "!add", "remove" })
public String removeRow(@ModelAttribute Form form, @RequestParam String remove)
{
String[] parts = remove.split(":", 2);
<div class="card-text">
<div class="form-group" th:each="row : ${card.value.entrySet()}">
<input type="checkbox" id="x" class="form-control" th:field="*{cards[__${card.key}__][__${row.key}__]}" />
- <label for="x" th:for="${#ids.prev('cards[__${card.key}__][__${row.key}__]')}" th:text="${row.value}">ROW_NAME</label>
+ <label for="x" th:for="${#ids.next('cards[__${card.key}__][__${row.key}__]')}" th:text="${row.key}">ROW_NAME</label>
<button type="submit" name="remove" class="btn btn-primary" th:value="|${card.key}:${row.key}|">Remove</button>
</div>
<div class="form-group">