我是百里香的新手。我现在有点困惑。请查看下面的代码
<th:block th:with="${someVarible=false}">
<th:block th:each="dem : ${demo}">
<th:block th:if="${dem.status==0}">
//Here I need to change the value of someVarible to true
</th:block>
</th:block>
<th:block th:if="${someVariable}">Its true</th:block>
</th:block>
Run Code Online (Sandbox Code Playgroud)
我需要编辑 someVarible 的值。我该怎么做。提前致谢。
你有表格吗?你如何发送数据到服务器?
如果您的变量为布尔类型,您可以添加例如用于编辑的复选框:
<th:block th:with="${someVarible=false}">
<th:block th:each="dem : ${demo}">
<th:block th:if="${dem.status==0}">
<label for="someVariableCheck">Edit someVariable</label>
<input id="someVariableCheck" type="checkbox" th:value="${someVariable}"/>
</th:block>
</th:block>
<th:block th:if="${someVariable}">Its true</th:block>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13552 次 |
| 最近记录: |