Announcement Announcement Module
Collapse
No announcement yet.
Indexed Forms with Spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Indexed Forms with Spring

    Hi,

    I have a Bean with a list of beans that I want to bind with Spring Web MVC. I know how to do it from the view:

    Code:
    <table class="fieldset">
    	<tbody>
    		<c:forEach var="attributeDefinition" items="productType.attributeDefinitions" varStatus="i">
    			<tr>
    				<td class="label">Attribute:</td>
    				<td><form:input path="attributeDefinitions[${i.index}].name" cssClass="field"/></td>
    				<td><img src="/images/site/add_16.png"></td>
    				<td><img src="/images/site/delete_16.png"></td>
    			</tr>
    		</c:forEach>
    	</tbody>					
    </table>
    But, I get IndexOutOfBoundException on submit. I've seen posts similar to this resolved by using ListUtils.lazyList... Is this the Spring sanctioned method? Seems like the binder should support this out of the box if the form tag does?

    John

  • #2
    AutoPopulatingList

    For posterity, I found AutoPopulatingList, which was inspired by the ListUtils in commons collections. You mean to tell me that the binder can't do this internally? This is invasive to the model

    Comment

    Working...
    X