【问题标题】:how to bind model to spring from tag radio button to populate list?如何将模型绑定到从标签单选按钮弹出以填充列表?
【发布时间】:2013-09-07 16:57:01
【问题描述】:

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

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

【问题讨论】:

    标签: html spring jsp spring-mvc


    【解决方案1】:

    试试这个:

    <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-06-29
      • 2021-07-19
      • 2020-01-19
      • 2017-04-09
      • 2012-03-19
      • 2013-05-24
      • 2017-01-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多