Announcement Announcement Module
No announcement yet.
Problem using spring:bind with RefreshablePagedListHolder and form submission Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem using spring:bind with RefreshablePagedListHolder and form submission

    i edited the looong post here and have gvn a simplified version of the problem below.

    plz show any mistakes i hv made
    Last edited by; Aug 18th, 2008, 07:19 AM.

  • #2

    hi all,

    so sorry for the long post up thr.. here is a much more simpler version of it.

    plz help me out.. I just started working with the spring framework and i have spent weeks trying to solve this issue but without much luck !!

    i have the following sring:bind working fine

    <c:forEach items="${subscriberList.pageList}" var="ipguser" varStatus="row">
                              <%--<form:hidden path="subscriberid"/>--%>
                              <table width="694" border="0">
                                      <td width="167" align="left" valign="middle" bgcolor="#DAE2E3" class="report-content"><a href="<c:url value="/subscriber/editprofile/editprofile.html"/><c:out value="?id="/><c:out value="${}"/>" class="report-content" onclick="changeFlage('<c:out value="${ipguser.msisdn}"/>')"><c:out value="${ipguser.msisdn}"/></a></td>
                                      <td width="167" align="left" valign="middle" bgcolor="#DAE2E3" class="report-content"><c:out value="${ipguser.firstName}"/><c:out value=" ${ipguser.lastName}"/></td>
                                      <td width="80" align="left" valign="middle" bgcolor="#DAE2E3" class="report-content"><c:out value="${ipguser.nic}"/></td>
                                      <td width="166" align="left" valign="middle" bgcolor="#DAE2E3" class="report-content"><c:out value="${ipguser.stateInStr}"/></td>
                                      <td width="100" align="center" bgcolor="#DAE2E3" class="report-topbar-text">
                                        <spring:bind path="subscriberList.pageList[${row.index}].doWhitelist">
                                          <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="checked"</c:if>  />
                                      <%--<td width="166" align="left" valign="middle" bgcolor="#DAE2E3" class="report-content"><form:checkbox path="ipguser.enabled"/></td>--%>
    next i have a simple submit button

    <input type="submit" name="submit" value="submit" onclick="setPath();"/>
    i set the URL parameters in the setPath() function where i remove any previously set URL parameter 'action'

    function setPath(){
                alert("setpath called")
                var url = window.location.href
                var indexOfQ = url.indexOf("&action")
                if (indexOfQ > -1) {
                    document.getElementById("subscriber").action=url.substring(0, indexOfQ)
                    alert("set path is " + window.location)
                    alert("path is set to " + url.substring(0, indexOfQ))
    path setting happens ok.

    but when i process the form bean at the controller class, the bound checkbox values are not set. so the required actions are not performed.

    but when the bean returns back, the previously checked values are retained. if i uncheck the checked checkboxes and resubmit the page - previously checked boxes are read as checked and the actions are performed.

    this means the binding does not occur at the submit event isn't it? can't figure out a solution thr.

    plz help me out

    thnx in advance
    Last edited by; Aug 18th, 2008, 07:21 AM.


    • #3
      events to use in obtaining the bound values

      i used the submit button as only a few form events automatically submit the changes made to the form.

      hv i made a mistake in the way i have used the submit button for form submission? or r thr any alternatives whr it is guaranteed of the value binding?


      • #4
        need some help

        hi all,

        need some help on this matter.... very very urgently

        thanx in advance