I am displaying a list of items using spring webflow. Each item has an edit button; clicking the button opens up a modal dialog. If there are 12 items in the list, I see 12 commas generated in the form path. How can I avoid generation of commas?
<c:forEach var="note" items="${model.modelname}">
//create a click button for each item
//each click opens up a modal
<div id="modal" class="hidden">
<div class="modal-body-content">
<form:textarea path="textPath" />
</div>
</div>
</c:forEach>
It appears that in a single form, you have multiple
textarea
fields with the exact same field name ("textPath") (and exact same DOM ID, which isn't good either).If so, I'm not surprised that Spring combines all the values submitted under that single name, with commas separating them. What Java type is your model bean's
textPath
field? I think if it were an array or maybeList
, you might get the values separated out. But that's just a guess.There are several issues at work. As noted by @dbreaux, all of your textarea elements are in the same form and have the same id; this is causing the commas when you post the form.
Here is an example of the solution I proposed in #2 above (Note: I don't have a system running that uses spring tags ATM, this example is untested):