From 8692e1e718bcfbe6c0988e1ecf792a83bd83f6f2 Mon Sep 17 00:00:00 2001 From: Wim Deblauwe Date: Sun, 5 May 2024 17:43:35 +0200 Subject: [PATCH] Add extra info in README about using multiple values in hx-vals --- README.md | 7 +++++++ .../htmx/spring/boot/thymeleaf/HtmxDialectTest.java | 3 ++- .../src/test/resources/templates/htmx-dialect.html | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ab247590..3e2bf3fd 100644 --- a/README.md +++ b/README.md @@ -303,6 +303,13 @@ will render as: (Given `user.id` has the value `1234`) +You can use multiple values like this: + +```html + +
+``` + ## Articles Links to articles and blog posts about this library: diff --git a/htmx-spring-boot-thymeleaf/src/test/java/io/github/wimdeblauwe/htmx/spring/boot/thymeleaf/HtmxDialectTest.java b/htmx-spring-boot-thymeleaf/src/test/java/io/github/wimdeblauwe/htmx/spring/boot/thymeleaf/HtmxDialectTest.java index 311137fd..ea6d29bd 100644 --- a/htmx-spring-boot-thymeleaf/src/test/java/io/github/wimdeblauwe/htmx/spring/boot/thymeleaf/HtmxDialectTest.java +++ b/htmx-spring-boot-thymeleaf/src/test/java/io/github/wimdeblauwe/htmx/spring/boot/thymeleaf/HtmxDialectTest.java @@ -127,7 +127,8 @@ void testWithHxVals() throws Exception { assertThat(html) .containsPattern("hx-vals-div-boolean.*hx-vals=\"\\{"someBooleanProperty":true}\"") .containsPattern("hx-vals-div-string.*hx-vals=\"\\{"someStringProperty":"someString"}\"") - .containsPattern("hx-vals-div-number.*hx-vals=\"\\{"someNumberProperty":12345}\""); + .containsPattern("hx-vals-div-number.*hx-vals=\"\\{"someNumberProperty":12345}\"") + .containsPattern("hx-vals-div-multiple.*hx-vals=\"\\{"someBooleanProperty":true,"someNumberProperty":12345}\""); } @Test diff --git a/htmx-spring-boot-thymeleaf/src/test/resources/templates/htmx-dialect.html b/htmx-spring-boot-thymeleaf/src/test/resources/templates/htmx-dialect.html index ef3ef838..33feee63 100644 --- a/htmx-spring-boot-thymeleaf/src/test/resources/templates/htmx-dialect.html +++ b/htmx-spring-boot-thymeleaf/src/test/resources/templates/htmx-dialect.html @@ -10,6 +10,7 @@ +
@@ -21,10 +22,12 @@
+
+