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