reset password
Author Message
aligh1979
Posts: 121
Posted 23:02 Oct 29, 2011 |

 

what would we do to bind a couple of inputs (text input or text area) to a List property of the Command object?

what we had done (even after using the custom class) was for binding one input to a property (of simple type or an object)

but we want each input to be set as an element of the List property .

I had done tons of research online , not very useful result . this is what I have come up with but have not tested it yet .

"assumming that thhe Criteria Class has a "List<String> Description" property

on the jsp side we have

<c:forEach var="j" begin="0" end= "................

<form:textarea path="${descriptions[j]}" rows="5" cols="30" />

 

 

is this the way to do it?

cysun
Posts: 2935
Posted 23:07 Oct 29, 2011 |

Yes (at least I can't think of anything better).

aligh1979
Posts: 121
Posted 17:49 Nov 01, 2011 |

this the right way to do

<c:forEach var="i" begin="0" end= .............................

<form:textarea path="descriptions[${i}]" rows="5" cols="30" />

........................................

Last edited by aligh1979 at 17:53 Nov 01, 2011.