tiago182
Feb 10th, 2006, 11:22 AM
Hello again,
I already could use the <spring:bind/> tag for binding text fields and checkboxes, but I've got no good results trying with combo-boxes, because the selected value isn't bound to my command object. I mean, after posting, AddProductForm.category comes null. Bellow follows what I've done:
public class AddProductForm {
private Category category = null;
private Collection<Category> availableCategories = new ArrayList();
// a bunch of other fields...
/* regular getters and setters */
}
<spring:bind path="command.category">
<select class="combo" name="<c: out value="${status.expression}"/>">
<c:forEach items="${command.availableCategories}" var="availableCategory">
<option value="<c: out value="${availableCategory}" />"><c: out value="${availableCategory}" /></option>
</c:forEach>
</select>
</spring:bind>
Can somebody tell me what's wrong with this?
Thanks in advance!
I already could use the <spring:bind/> tag for binding text fields and checkboxes, but I've got no good results trying with combo-boxes, because the selected value isn't bound to my command object. I mean, after posting, AddProductForm.category comes null. Bellow follows what I've done:
public class AddProductForm {
private Category category = null;
private Collection<Category> availableCategories = new ArrayList();
// a bunch of other fields...
/* regular getters and setters */
}
<spring:bind path="command.category">
<select class="combo" name="<c: out value="${status.expression}"/>">
<c:forEach items="${command.availableCategories}" var="availableCategory">
<option value="<c: out value="${availableCategory}" />"><c: out value="${availableCategory}" /></option>
</c:forEach>
</select>
</spring:bind>
Can somebody tell me what's wrong with this?
Thanks in advance!