0

我正在尝试将 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>

如果有其他解决方案,请让我知道。提前致谢

4

1 回答 1

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>
于 2013-09-07T17:19:03.910 回答