Announcement Announcement Module
No announcement yet.
List and RadioButton Group Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • List and RadioButton Group


    I have a problem selecting only one radio button when the list of radio buttons is displayed dynamically. I need a radio button group like functionality.

    Also when the form gets submitted i want to retrieve the updated selection.

    consider the follwing scenarios customer has a list of adrresses and out of which one address can be active.

    something like the following ...

    <form:form commandName="customer" method="post">
    <c:forEach items="${customer.address}" varStatus="addressRow">
    <spring:bind path="customer.address[${addressRow.index}].active">
    <form:radiobutton path="${status.expression}" />
    <input type="checkbox" name="<c:out value="${status.expression}"/>" value="${status.value}"
    <c:if test="${status.value}">checked</c:if>/>

    <input type="submit" name="update" value="update" />

    If we require radiobutton group like functionality then we need to have same name to all the radio buttons (name="<c:out value="XXXX"), but when the values are submitted back to the server with this approach then we dont get new selection

    How to get the desired behviour

  • #2
    I have the same question. Any solution?