Announcement Announcement Module
Collapse
No announcement yet.
checkbox binding problem with spring mvc Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • checkbox binding problem with spring mvc

    Hi,

    I am trying to use checkbox(es) and not been able to successfully bind it to objects. Following is my JSP page -

    <form name="myform" method="post" action="reviewList.htm">
    <input type="hidden" name="action"/>
    <input type="hidden" name="_${status.expression}"/>
    <table align="center" bgcolor="#ddddff" width="98%" border="0" cellspacing="1" cellpadding="1">
    <tr>
    <td class="TableHeaderText" width="2%"></td>
    <td class="TableHeaderText" width="5%"><a href="reviewList.htm?index=<c:out value="${index}"/>&param=id&order=<c:out value="${order}"/>"><c:out value="ID"/></a></td>
    <td class="TableHeaderText" width="35%"><a href="reviewList.htm?index=<c:out value="${index}"/>&param=email&order=<c:out value="${order}"/>"><c:out value="Email"/></a></td>
    <td class="TableHeaderText" width="25%"><a href="reviewList.htm?index=<c:out value="${index}"/>&param=firstName&order=<c:out value="${order}"/>"><c:out value="First Name"/></a></td>
    <td class="TableHeaderText" width="25%"><a href="reviewList.htm?index=<c:out value="${index}"/>&param=lastName&order=<c:out value="${order}"/>"><c:out value="Last Name"/></a></td>
    </tr>
    <c:forEach items="${reviews.list}" var="review" begin="0">
    <tr class="TableRowText">
    <td>
    <input type="checkbox" name="${status.expression}" value="${status.value}"
    <c:if test="${status.value}">selected</c:if> />
    </td>
    <td><a href="<c:out value="reviewDetail.htm?id=${review.id}"/>"><c:out value="${review.id}"/></a></td>
    <td><a href="mailto:<c:out value="${review.user.email}"/>"><c:out value="${review.user.email}"/></td>
    <td><c:out value="${review.user.firstName}"/></td>
    <td><c:out value="${review.user.lastName}"/></td>
    </tr>
    </c:forEach>
    <tr bgcolor="#ffffff" bordercolor="#ffffff">
    <td align="center" colspan="4" width="33%">
    <input type="submit" value="delete" name="delete" class="mylabButton"/>
    </td>
    </tr>
    </table>

    Please help if anybody knows about this problem.

    Thanks

  • #2
    Try searching

    http://forum.springframework.org/showthread.php?t=17646
    Last edited by robyn; May 14th, 2006, 10:05 AM.

    Comment


    • #3
      checkbox problem

      I've gone through that link and tried exactly the same way but didn't work.

      Comment


      • #4
        I don't see any spring bind tags... so maybe that is your problem:
        Code:
        <spring&#58;bind path="myCommand.springIsFun">
        	<input type="hidden" name="_$&#123;status.expression&#125;">
             	<input name="springIsFun" type="checkbox" <c&#58;if test="$&#123;status.value&#125;">checked</c&#58;if>/>
        </spring&#58;bind>
        and my command has:
        Code:
        boolean springIsFun;
        try that,
        Ryan

        Comment

        Working...
        X