<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-devtools</artifactId>
+ <optional>true</optional>
</dependency>
<dependency>
package de.juplo.demo;
+import java.util.HashMap;
import java.util.Map;
+import java.util.TreeMap;
/**
*/
public class Form
{
- Map<Integer, Map<String, Boolean>> cards;
- Map<Integer, String> row;
+ Map<Integer, Map<String, Boolean>> cards = new TreeMap<>();
+ Map<Integer, String> row = new HashMap<>();
public Map<Integer, Map<String, Boolean>> getCards()
</nav>
<main class="container mt-5">
<form action="#" th:action="@{/}" th:object="${form}" method="get">
- <div class="card" th:each="card : *{cards.rowSet()}">
+ <div class="card" th:each="card : *{cards.entrySet()}">
<div class="card-header"><h1 th:text="|Card #${card.key}|">Card #X</h1></div>
<div class="card-body">
<div class="card-text">
- <div class="form-group" th:each="row : ${card.value.rowSet()}">
+ <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>
<button type="submit" name="removeRow" class="btn btn-primary" th:value="|${card.key}:${row.key}|">Remove</button>