newbie: binding problems / indexed properties / checkbox
hello,
I'm very new to spring and webflow and stumble over my first problem.
I hope you have a minute or two and can help me :-)
My form object has a collection filled with CodedText items
pseudo code:
class CodedText {
code
text
}
At the (JSP) view I display this list:
<c:forEach var="type" items="${order.types}" varStatus="s">
<tr><td>
<spring:bind path="order.types[${s.index}].code">
<input type="checkbox"
name="${status.expression}"
value="${status.value}"/>
</spring:bind>
</td>
<td>
<c:out value="${type.text}"/> (<c:out value="${type.code}"/>)
</td>
</tr>
</c:forEach>
This list is prefixed with a checkbox. I want to collect to users choice, but can't get the binding to work proberly :cry:
Questions:
- How should I bind the users choice ?
- How could I redisplay the page and show the current users choice ?
TIA, leif
Binding Multiple value with CheckBox
Hi all,
I got some information about binding list values when using Checkbox.
But in the below mentioned code, can please anyone tell me,
how to create checked property when binding the list with spring
<c:forEach items="${myDataModel.drivers}" var="driver" varStatus="loopStatus">
<spring:bind path="myDataModel.drivers[${loopStatus.index}].checked">
<input class="checkbox" type="checkbox"
name ="<c:out values = "_${status.expression}"/>"
value = "true" <c:if test="${status.value}">CHECKED</c:if> >
</spring:bind>
</c:forEach>
Please help me
Thanks in advance
Shilpa
Binding multiple value with checkbox
Quote:
Originally Posted by strug
hello,
I'm very new to spring and webflow and stumble over my first problem.
I hope you have a minute or two and can help me :-)
My form object has a collection filled with CodedText items
pseudo code:
class CodedText {
code
text
}
At the (JSP) view I display this list:
<c:forEach var="type" items="${order.types}" varStatus="s">
<tr><td>
<spring:bind path="order.types[${s.index}].code">
<input type="checkbox"
name="${status.expression}"
value="${status.value}"/>
</spring:bind>
</td>
<td>
<c:out value="${type.text}"/> (<c:out value="${type.code}"/>)
</td>
</tr>
</c:forEach>
This list is prefixed with a checkbox. I want to collect to users choice, but can't get the binding to work proberly :cry:
Questions:
- How should I bind the users choice ?
- How could I redisplay the page and show the current users choice ?
TIA, leif
In the above code, can you please tell me where i need to create code code when binding list object.
Thanks
Shilpa