Is it possible to to edit and submit a collection of multiple records using struts?
for example I have the following Action Form defined
public class AttributeForm extends ActionForm{
private String name;
private String value;
private boolean stamped;
}
On the server an ArrayList is created and populated with multiple instances
of this AttributeForm object.
This collection of AttributeForm attributes are displayed to a user
in as a list of records.
The name and value attributes and the stamped attribute are all editiable by the user.
<%@ taglib uri="struts-bean.tld" prefix="bean" %>
<%@ taglib uri="struts-html.tld" prefix="html" %>
<html:form action="/attributes/save.do">
<TABLE cellspacing="0" cellpadding="0" border="0">
<TBODY>
<logic:notEmpty name="attributeList">
<logic:iterate id="attribute"
name="attributeList">
<TR>
<TD>Name:</TD>
<TD>
<html:select property="${attribute.name}"
value="${attribute.name}">
<html
ption value="A">A</html
ption>
<html
ption value="B">B</html
ption>
</html:select></TD>
<TD>Value:</TD>
<TD>
<html:text property="${attribute.value}" size="16"
value="${attribute.value}"/>
</TD>
</TR>
</logic:iterate>
</logic:notEmpty>
<TR>
<TD colspan="3" align="right">
<html:submit/>
</TD>
</TR>
</TBODY>
</TABLE>
</html:form>
Is it possible to collect all of the modified attributes for each line Item
and submit them as a colection of these ActionForms when the submit button is clicked?