Thanks but this does not seem like a very good example, it is hardcoded to only show 2 radio buttons and their values are hardcoded.
I have almost managed to get things working with the following code which is flexible regarding number of radio buttons and their value. The trouble i can never get the if statement to evaluate to true even though the values appear equal I have printed the value of status.value to confirm this.
Code:
<tr>
<spring:bind path="Portfolio.type">
<td class="tablecolheader">Portfolio Type</td>
<td><c:out value="${status.value}"/>
<c:forEach items="${portfoliotypes}" var="portfoliotype">
<input type="radio"
name="<c:out value="${status.expression}"/>"
value="<c:out value="${portfoliotype.id}"/>"
<c:if test='${status.value} =="${portfoliotype.id}'>checked</c:if>>
<c:out value="${portfoliotype.name}"/>
</c:forEach>
</td>
</spring:bind>
</tr>
this is rendered to
Code:
<td class="tablecolheader">Portfolio Type</td>
<td>2
<input type="radio"
name="type"
value="1"
>
Long
<input type="radio"
name="type"
value="2"
>
Short
<input type="radio"
name="type"
value="3"
>
Long/Short
</td>
Note there is no checked.