亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

列表對象的 Thymeleaf 顯示字段

列表對象的 Thymeleaf 顯示字段

三國紛爭 2023-03-09 14:34:55
我有<table style="padding-top: 15px; padding-left: 50px; width: 1366px;">    <tr>        <thead>        <th>STT</th>        <th width="24%">S? tài kho?n</th>        <th width="24%">Tên ngan hàng</th>        <th width="24%">Chi nhánh</th>        <th width="24%">T?nh/TP c?a ngan hàng</th>        </thead>        <tbody>        <tr th:each="item, itemStat : ${accountObjectForm.accountObjectBankAccountList}">            <td><span th:text="${itemStat.index + 1}"></span></td>            <td><input type="text" th:value="${accountObjectForm.accountObjectBankAccountList[0].bankAccount}" th:name="|accountObjectBankAccountList[${itemStat.index}].bankAccount|" th:id="|accountObjectBankAccountList[${itemStat.index}].bankAccount|" class="k-textbox" style="width: 100%;"></td>            <td><input type="number" th:name="|accountObjectBankAccountList[${itemStat.index}].bankId|" th:id="|accountObjectBankAccountList[${itemStat.index}].bankId|" class="k-textbox" style="width: 100%"></td>            <td><input type="text" th:name="|accountObjectBankAccountList[${itemStat.index}].bankBranchName|" th:id="|accountObjectBankAccountList[${itemStat.index}].bankBranchName|" class="k-textbox" style="width: 100%;"></td>            <td><input type="text" th:name="|accountObjectBankAccountList[${itemStat.index}].province|" th:id="|accountObjectBankAccountList[${itemStat.index}].province|" class="k-textbox" style="width: 100%;"></td>        </tr>        <script>            $(document).ready(function () {                var dataBank = new kendo.data.DataSource({                    transport: {                        read: {                            url: "/banks_json",                            dataType: "json"                        }                    },                    pageSize: 30                });結果 
查看完整描述

2 回答

?
MMMHUHU

TA貢獻1834條經驗 獲得超8個贊

省略表達式中的內${...}括號,直接引用itemStat.index。您已經在使用 thymeleaf 表達式語法,無需使用它兩次。

不確定這是否是您的代碼的唯一問題,但肯定首先要修復


查看完整回答
反對 回復 2023-03-09
?
冉冉說

TA貢獻1877條經驗 獲得超1個贊

另一個解決方案

<td><input type="text" th:value="${accountObjectForm.accountObjectBankAccountList[__${itemStat.index}__].bankAccount}" th:name="|accountObjectBankAccountList[${itemStat.index}].bankAccount|" th:id="|accountObjectBankAccountList[${itemStat.index}].bankAccount|" class="k-textbox" style="width: 100%;"></td>



查看完整回答
反對 回復 2023-03-09
  • 2 回答
  • 0 關注
  • 199 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號