-
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
Showing
37 changed files
with
246 additions
and
124 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 was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
examples/jte-demo/src/main/kotlin/de/tschuehly/jteviewcomponentdemo/core/ExampleService.kt
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
...-demo/src/test/kotlin/de/tschuehly/jteviewcomponentdemo/application/JteTestApplication.kt
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
...ples/jte-demo/src/test/kotlin/de/tschuehly/jteviewcomponentdemo/application/web/Router.kt
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...kotlin/de/tschuehly/jteviewcomponentdemo/application/web/index/IndexTestViewComponent.jte
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
.../kotlin/de/tschuehly/jteviewcomponentdemo/application/web/index/IndexTestViewComponent.kt
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,12 @@ | ||
rootProject.name = "jte-example" | ||
|
||
includeBuild("..\\..\\jte"){ | ||
dependencySubstitution { | ||
substitute(module("de.tschuehly:spring-view-component-jte")).using(project(":")) | ||
} | ||
} | ||
includeBuild("..\\..\\core"){ | ||
dependencySubstitution { | ||
substitute(module("de.tschuehly:spring-view-component-core")).using(project(":")) | ||
} | ||
} |
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
...ples/jte-example/src/main/kotlin/de/tschuehly/jteviewcomponentdemo/core/ExampleService.kt
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,25 @@ | ||
package de.tschuehly.jteviewcomponentdemo.core | ||
|
||
import org.springframework.stereotype.Service | ||
import java.util.NoSuchElementException | ||
|
||
@Service | ||
class ExampleService { | ||
var dataIndex = 0 | ||
val itemList = mutableMapOf<Int, String>() | ||
|
||
fun getHelloWorld(): String { | ||
return "Hello World" | ||
} | ||
|
||
fun addItemToList(item: String){ | ||
itemList[dataIndex] = item | ||
dataIndex += 1 | ||
} | ||
|
||
fun deleteItem(id: Int) { | ||
itemList.remove(id) ?: throw NoSuchElementException("No Element with Id: $id found") | ||
} | ||
|
||
|
||
} |
File renamed without changes.
50 changes: 50 additions & 0 deletions
50
...mple/src/main/kotlin/de/tschuehly/jteviewcomponentdemo/web/action/ActionViewComponent.jte
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,50 @@ | ||
@import de.tschuehly.jteviewcomponentdemo.web.action.ActionViewComponent.Person | ||
@param Integer counter | ||
@param java.util.Map<int,String> itemList | ||
@param Person person | ||
|
||
<html> | ||
<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.