0

これが私のJSPです。

<form:form action="changeSrtOrdrRecoveryAccount.do" id="sortOvrlyFrm" autocomplete="off">
          <c:if test="${not empty recoveryAccts}">
              <ng:dep-datatable stretch="true" xstyle="border:0">
                <ng:dep-datatable-tr xstyle="border:0;background-color:#FFFFFF;">
                  <ng:dep-datatable-th xstyle="border:0"><fmt:message key="label.rcvyAcct"/></ng:dep-datatable-th>
                  <ng:dep-datatable-th xstyle="border:0">Sort Order</ng:dep-datatable-th>
                 </ng:dep-datatable-tr>
                  <c:forEach items="${recoveryAccts }" var="recAcct">
                       <ng:dep-datatable-tr xstyle="border:0">
                           <ng:dep-datatable-cell xclass="borderlessTableCell">
                              <input type="text" name="recAcct" value="<c:out value="${recAcct}"/>" readonly="readonly" />
                           </ng:dep-datatable-cell>
                           <ng:dep-datatable-cell xclass="borderlessTableCell">
                              <select name="srtOption">
                                <option value="<c:out value="${recAcct}-0"/>">0</option>
                                <c:forEach var="i" begin="1" end="${total}" step="1" varStatus ="status">
                                    <option value="<c:out value="${recAcct}"/>-<c:out value="${i}"/>"><c:out value="${i}"/></option>
                                </c:forEach>
                              </select>
                           </ng:dep-datatable-cell>
                       </ng:dep-datatable-tr>
                  </c:forEach>

                 </ng:dep-datatable> 
          </c:if>
       </form:form>

生成されたコードは次のとおりです。最初のアカウントの srtOption に値 1 を割り当て、2 番目のアカウントに値 2 を割り当てて表示する方法を探しています。現在のコードでは、srtOption ドロップダウン リストに 0 が表示されます。両方のアカウント。次のように選択したものを追加すると、ドロップダウンに表示される両方のアカウントの値は 2 になります。

<option selected value="<c:out value="${recAcct}"/>-<c:out value="${i}"/>"><c:out value="${i}"/></option>

q

 <table   style="border:0" class="wt-ng-dt-dep wt-ng-dt-dep-stretch" cellpadding="0" cellspacing="0">
                <tr  style="border:0;background-color:#FFFFFF;" class="wt-ng-dt-dep-tr wt-ng-dt-dep-tr-header">
                  <th  style="border:0" class="wt-ng-dt-dep-th">Recovery Account</th>
                  <th  style="border:0" class="wt-ng-dt-dep-th">Sort Order</th>
                 </tr>

                       <tr  style="border:0" class="wt-ng-dt-dep-tr">
                           <td  class="borderlessTableCell wt-ng-dt-dep-cell wt-ng-dt-dep-cell-first">
                              <input type="text" name="recAcct" value="1234567891234      - 1" readonly="readonly" />
                           </td>
                           <td  class="borderlessTableCell wt-ng-dt-dep-cell wt-ng-dt-dep-cell-first">
                              <select name="srtOption">
                                <option value="1234567891234      - 1-0">0</option>

                                    <option selected value="1234567891234      - 1-1">1</option>

                                    <option selected value="1234567891234      - 1-2">2</option>

                              </select>
                           </td>
                       </tr>

                       <tr  style="border:0" class="wt-ng-dt-dep-tr">
                           <td  class="borderlessTableCell wt-ng-dt-dep-cell">
                              <input type="text" name="recAcct" value="9876543219876      - 2" readonly="readonly" />
                           </td>
                           <td  class="borderlessTableCell wt-ng-dt-dep-cell">
                              <select name="srtOption">
                                <option value="9876543219876      - 2-0">0</option>

                                    <option selected value="9876543219876      - 2-1">1</option>

                                    <option selected value="9876543219876      - 2-2">2</option>

                              </select>
                           </td>
                       </tr>


                 </table>

これを手伝ってくれてありがとう

4

1 に答える 1