如何将模型绑定到弹出标签单选按钮以填充列表?

时间:2013-09-07 16:57:01

标签: html spring jsp spring-mvc

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

如果有其他解决方案,请告诉我。谢谢提前

1 个答案:

答案 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>