We have a List that we outject into the page to be rendered and a table that displays each ticket row by row.
<tbody>
#{list reqs, as:'req'}
<tr>
<td>#{req.ticketNumber}</td>
<td>
<input type="text" class="boxtpl" name="${req.name}" value="${req.points}" maxlength="4">
</td>
<td style="text-align: left;">#{req.name}</td>
<td>#{req.subproject.name}</td>
<td>#{req.assignedUser.firstName} #{req.assignedUser.lastName}</td>
</tr>
#{/list}
</tbody>
So, obviously the rendering is the easy part…..How do we go about the posting part such that the req.points is filled in with what the user typed in? It seems we would have to do something complicated like use req.name or something and I am not even sure that would work. Anyone have an example of how to post a form from a table in the playframework?
thanks,
Dean
You can use the index variable of your list tag to index your names
Then you get back in your controller a list.
Be careful, play does some merging stuff with JPA objects and if you have some nested objects you can have some problems