-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thomas Schuehly
committed
Aug 27, 2023
1 parent
e5fa506
commit d93fba8
Showing
16 changed files
with
543 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
.../tschuehly/spring/viewcomponent/thymeleaf/application/web/action/ActionViewComponent.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<script src="http://localhost:35729/livereload.js"></script> | ||
<script defer src="/webjars/htmx.org/dist/htmx.min.js"></script> | ||
</head> | ||
<body> | ||
<h2>ViewAction Get CountUp</h2> | ||
|
||
<button view:action="countUp">Default ViewAction [GET]</button> | ||
<h3 th:text="${counter}"></h3> | ||
|
||
<h2>ViewAction Post AddItem</h2> | ||
<form view:action="addItem"> | ||
<input type="text" name="item"> | ||
<button type="submit">Save Item</button> | ||
</form> | ||
<table> | ||
<tr> | ||
<th>Item</th> | ||
<th>Action</th> | ||
</tr> | ||
<tr th:each="item : ${itemList}"> | ||
<td> | ||
<span th:text="${item.value}"></span> | ||
</td> | ||
<td> | ||
<button th:view:action="|deleteItem?id=${item.key}|">Delete Item [[${item.key}]]</button> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
<h2>ViewAction Put/Patch Person Form</h2> | ||
|
||
<form th:object="${person}" style="display: inline-grid; gap: 0.5rem"> | ||
<label> | ||
Name <input type="text" th:field="*{name}"> | ||
</label> | ||
<label> | ||
Age: <input type="number" th:field="*{age}"> | ||
</label> | ||
<label> | ||
Location: <input type="text" th:field="*{location}"> | ||
</label> | ||
<button type="submit" view:action="savePersonPut">Save Changes using Put</button> | ||
<button type="submit" view:action="savePersonPatch">Save Changes using Patch</button> | ||
</form> | ||
</body> | ||
</html> |
Oops, something went wrong.