0
這是我的JSP。在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>
這是我的生成code.I在尋找一種方法來分配和用於srtOption用於所述第二account.With當前代碼的第一帳戶和2值的1顯示值,0是beind在我添加在以下 選擇像兩者accounts.If的srtOption下拉列表顯示然後在下拉菜單中顯示的兩個帳戶的值是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>
謝謝你們對此的任何幫助