Results 1 to 4 of 4

Thread: Problem using spring:bind with RefreshablePagedListHolder and form submission

  1. #1
    Join Date
    Aug 2008
    Location
    Kandy, Sri Lanka
    Posts
    4

    Default 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 gayani.sew; Aug 18th, 2008 at 06:19 AM.

  2. #2
    Join Date
    Aug 2008
    Location
    Kandy, Sri Lanka
    Posts
    4

    Default simplified

    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

    Code:
    <c:forEach items="${subscriberList.pageList}" var="ipguser" varStatus="row">
                              <%--<form:hidden path="subscriberid"/>--%>
                              <table width="694" border="0">
                                  <tr>
                                      <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="${ipguser.id}"/>" 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>  />
                                        </spring:bind>
                                      </td>
                                      <%--<td width="166" align="left" valign="middle" bgcolor="#DAE2E3" class="report-content"><form:checkbox path="ipguser.enabled"/></td>--%>
                                  </tr>
                              </table>
                          </c:forEach>
    next i have a simple submit button

    Code:
    <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'

    Code:
    function setPath(){
                alert("setpath called")
                var url = window.location.href
                var indexOfQ = url.indexOf("&action")
                alert(indexOfQ)
                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 gayani.sew; Aug 18th, 2008 at 06:21 AM.

  3. #3
    Join Date
    Aug 2008
    Location
    Kandy, Sri Lanka
    Posts
    4

    Default 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. #4
    Join Date
    Aug 2008
    Location
    Kandy, Sri Lanka
    Posts
    4

    Default need some help :(

    hi all,

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

    thanx in advance
    gayani

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •