shoa
Aug 13th, 2006, 05:39 AM
Hello
I want to use checkboxes for selecting in my application and find out a way to do that as the following:
=========================================
<c:forEach items="${command.childArray}" var="child" varStatus="loopStatus">
<spring:bind path="command.childArray[${loopStatus.index}].selected">
<input type="hidden" name="_<c:out value="${status.expression}"/>">
<input type="checkbox" name="<c:out value="${status.expression}"/>" value="true"
<c:if test="${status.value}">checked</c:if>/>
</spring:bind>
</c:forEach>
========================================
It can be seen that to use this way, the objects (for selecting) must be in an array (childArray). So I can have:
<spring:bind path="command.childArray[${loopStatus.index}].selected">
What I have to do if it is a list - not an array ???.
I tried:
<spring:bind path="command.objectList.get(loopStatus.index).selected">
But it does not work
Thanks for any help
sho
I want to use checkboxes for selecting in my application and find out a way to do that as the following:
=========================================
<c:forEach items="${command.childArray}" var="child" varStatus="loopStatus">
<spring:bind path="command.childArray[${loopStatus.index}].selected">
<input type="hidden" name="_<c:out value="${status.expression}"/>">
<input type="checkbox" name="<c:out value="${status.expression}"/>" value="true"
<c:if test="${status.value}">checked</c:if>/>
</spring:bind>
</c:forEach>
========================================
It can be seen that to use this way, the objects (for selecting) must be in an array (childArray). So I can have:
<spring:bind path="command.childArray[${loopStatus.index}].selected">
What I have to do if it is a list - not an array ???.
I tried:
<spring:bind path="command.objectList.get(loopStatus.index).selected">
But it does not work
Thanks for any help
sho