我正在尝试将listOftriptransactions列表绑定到单选按钮。在我的情况下更新值,单击单选按钮值后没有得到更新,它需要以前的值。
<table>
<c:forEach items="${listOftriptransactions}" var="trans" varStatus="mystatus">
<tr>
<td>
<form:radiobutton path="${listOftriptransactions[mystatus.index].isReceived}" checked="checked" />yes
<form:radiobutton path="${listOftriptransactions[mystatus.index].isReceived}" checked="checked" />No
</td>
</tr>
</c:forEach>
</table>
如果有其他解决方案,请告诉我。谢谢提前
答案 0 :(得分:0)
试试这个:
<table>
<c:forEach items="${listOftriptransactions}" var="trans" varStatus="mystatus">
<tr>
<td>
<form:radiobutton path="listOftriptransactions[${mystatus.index}].isReceived" value="true">Yes</form:radiobutton>
<form:radiobutton path="listOftriptransactions[${mystatus.index}].isReceived" value="false">No</form:radiobutton>
</td>
</tr>
</c:forEach>
</table>