「kaz_javaSpringBootプログラム自動作成◎生成ツール」親子テーブル変更画面で子供データを削除すると画面が壊れることがわかった。ので、修正する
バグ修正 <ーver1.6で修正する予定です。
■親子テーブル変更画面(1つの子供データが2行表示のパターン)で子供データを削除すると画面が壊れることがわかった。ので、修正する
例:purchaseHistAmendRegister.html 購入履歴情報管理・購入履歴情報変更・購入履歴明細情報一覧登録
修正前:
<td align="center" nowrap rowspan="2">
<th:block th:if="${mode == 'ins'} " >
<a th:href="'JavaScript:document.frm.num.value =\'' + ${status.count} + '\';do_Submit_Clk2(\'insListJoin_del\');'">
<img src="/img/btn/btn_delete.gif" alt="削除" width="38" height="20" border="0"></a>
</th:block>
<th:block th:if="${mode != 'ins'} " >
<a th:href="'JavaScript:document.frm.num.value =\'' + ${status.count} + '\';do_Submit_Clk2(\'updListJoin_del\');'">
<img src="/img/btn/btn_delete.gif" alt="削除" width="38" height="20" border="0"></a>
</th:block>
</td>
</th:block>
</tr>
<tr>
<td th:class="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].unitPrice')} ? 'error' : 'none'">
<input th:field="*{purchaseDetailHistJoinCFormList[__${status.index}__].unitPrice}" class="form-eng" type="text" size="30" maxlength="20" />
<div th:if="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].unitPrice')}" th:errors="*{purchaseDetailHistJoinCFormList[__${status.index}__].unitPrice}" th:errorclass="font-s-red-form"></div>
</td>
<td th:class="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].quantity')} ? 'error' : 'none'">
<input th:field="*{purchaseDetailHistJoinCFormList[__${status.index}__].quantity}" class="form-eng" type="text" size="30" maxlength="20" />
<div th:if="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].quantity')}" th:errors="*{purchaseDetailHistJoinCFormList[__${status.index}__].quantity}" th:errorclass="font-s-red-form"></div>
</td>
<td th:class="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].price')} ? 'error' : 'none'">
<input th:field="*{purchaseDetailHistJoinCFormList[__${status.index}__].price}" class="form-eng" type="text" size="30" maxlength="20" />
<div th:if="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].price')}" th:errors="*{purchaseDetailHistJoinCFormList[__${status.index}__].price}" th:errorclass="font-s-red-form"></div>
</td>
</tr>
</th:block>
修正後:
<td align="center" nowrap rowspan="2">
<th:block th:if="${mode == 'ins'} " >
<a th:href="'JavaScript:document.frm.num.value =\'' + ${status.count} + '\';do_Submit_Clk2(\'insListJoin_del\');'">
<img src="/img/btn/btn_delete.gif" alt="削除" width="38" height="20" border="0"></a>
</th:block>
<th:block th:if="${mode != 'ins'} " >
<a th:href="'JavaScript:document.frm.num.value =\'' + ${status.count} + '\';do_Submit_Clk2(\'updListJoin_del\');'">
<img src="/img/btn/btn_delete.gif" alt="削除" width="38" height="20" border="0"></a>
</th:block>
</td>
</th:block>
</tr>
<<追加 start>>
<th:block th:if="*{purchaseDetailHistJoinCFormList[__${status.index}__].delKbn == ''}">
<<追加 end>>
<tr>
<td th:class="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].unitPrice')} ? 'error' : 'none'">
<input th:field="*{purchaseDetailHistJoinCFormList[__${status.index}__].unitPrice}" class="form-eng" type="text" size="30" maxlength="20" />
<div th:if="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].unitPrice')}" th:errors="*{purchaseDetailHistJoinCFormList[__${status.index}__].unitPrice}" th:errorclass="font-s-red-form"></div>
</td>
<td th:class="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].quantity')} ? 'error' : 'none'">
<input th:field="*{purchaseDetailHistJoinCFormList[__${status.index}__].quantity}" class="form-eng" type="text" size="30" maxlength="20" />
<div th:if="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].quantity')}" th:errors="*{purchaseDetailHistJoinCFormList[__${status.index}__].quantity}" th:errorclass="font-s-red-form"></div>
</td>
<td th:class="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].price')} ? 'error' : 'none'">
<input th:field="*{purchaseDetailHistJoinCFormList[__${status.index}__].price}" class="form-eng" type="text" size="30" maxlength="20" />
<div th:if="${#fields.hasErrors('purchaseDetailHistJoinCFormList[__${status.index}__].price')}" th:errors="*{purchaseDetailHistJoinCFormList[__${status.index}__].price}" th:errorclass="font-s-red-form"></div>
</td>
</tr>
<<追加 start>>
</th:block>
<<追加 end>>
</th:block>