]> juplo.de Git - demos/spring-boot/commitdiff
WIP
authorKai Moritz <kai@juplo.de>
Tue, 21 Jan 2020 19:15:06 +0000 (20:15 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 21 Jan 2020 19:15:06 +0000 (20:15 +0100)
pom.xml
src/main/java/de/juplo/demo/Form.java
src/main/resources/templates/form.html

diff --git a/pom.xml b/pom.xml
index 91648a974d915ffcf02ab44f99570ff87ed9a3d5..88630fe01d0fb458949058bf83ea8902e12f6ee6 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                        <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>
        </dependencies>
 
index 382c335b848d56e317f3697fc521dc9abc582413..7dceac30c1588fedfe28d83e0bfdd39595b09c1c 100644 (file)
@@ -1,7 +1,9 @@
 package de.juplo.demo;
 
 
+import java.util.HashMap;
 import java.util.Map;
+import java.util.TreeMap;
 
 
 /**
@@ -10,8 +12,8 @@ import java.util.Map;
  */
 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()
index 586a812dcbb224755a3a1015a35841c6640fa3e0..b1f53d89c2c42763a4c33d9f8c84b2b875fe851a 100644 (file)
     </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>