java - Thymeleaf th:value 在使用 th:field 时被忽略
问题描述
我有一个表单,可以在其中遍历 class 的项目列表Runway
。我正在尝试将初始值设置为th:value = "${rwy.getDir1()}"
并将输入连接到另一个对象th:field = "*{messageList[__${mStat.index}__].runway}"
,但th:value
忽略了。
<div th:each="rwy, mStat: ${runways}">
<label>Runway</label>
<input type="text" class="text-input-small" th:field = "*{messageList[__${mStat.index}__].runway}" th:value = "${rwy.getDir1()}" th:id="'runway' + ${mStat.index}" th:name = "runway">
</div>
如何将字段映射到messageList
并使用 设置初始值th:value = "${rwy.getDir1()}"
?
解决方案
推荐阅读
- python - 如何加入 Pandas Dataframes 并多次保留左列?
- dart - 如何将 photo_reference 值存储为字符串?
- android - Drawable array from xml into int for recycler adapter
- ruby-on-rails - Create data from another model
- node.js - Analog `fs.readdirSync` node.js without recursive
- sql - 如果在 Laravel 5.4 中每个用户一次有超过 1 个会话,则自动注销
- javascript - 将 D3 圆形包装图从 V3 升级到 V4
- php - 从 php 中的 json 数据中检索 longurl
- python - Tensorflow Eager 和 Tensorboard 图?
- r - 如何在R中用一个因子操作两个变量