That was, more or less, why I suggested manually creating an array index in the name of the field.
--- On Thu, 6/26/08, Kleiderman, Matthew <[EMAIL PROTECTED]> wrote: > From: Kleiderman, Matthew <[EMAIL PROTECTED]> > Subject: RE: Multi-row tabular forms > To: "Struts Users Mailing List" <user@struts.apache.org> > Date: Thursday, June 26, 2008, 7:53 AM > And I think the problem I'm having is figuring out what > to do in the > absence of an indexed property in the s:textfield tag - > there's nothing > in the generated HTML that suggests this is going into a > Collection on > the Action side. > > - Matt > > -----Original Message----- > From: Nikhil Walvekar [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 26, 2008 7:37 AM > To: Struts Users Mailing List > Subject: Re: Multi-row tabular forms > > Hi Matt, > > For Struts 1.1, I used to do following things: > > <logic:iterate id="dataObjects" > property="dataObjects" > indexId="cnt"> > <html:text name="dataObjects" > property="property1" > indexed="true"/> > <html:text name="dataObjects" > property="property2" > indexed="true"/> </html:iterate> > > Syntax may be wrong (tried 2 yrs back :D ). > > But with this, I got another error, while populating data > into form. The > collection needs to have required number of objects. > If you know that only 2 rows will be present then you can > populate > collection with 2 empty object, else you might get > NullPointer. > > Regards, > Nikhil > > On Thu, Jun 26, 2008 at 4:16 AM, Kleiderman, Matthew < > [EMAIL PROTECTED]> wrote: > > > I'm trying create a form that maps to a collection > of data objects, so > > > that a user can edit any property of any object, and > submit the > changes. > > I'm using an s:iterator tag to draw each item in > the collection as a > > row in a table, and the xhtml template. The table is > getting drawn > > properly, with data filled in from the collection - > but the Action > > receiving the data always has the Collection set to > null. Here's a > > stripped-down excerpt of what the .jsp looks like: > > > > <s:form theme="xhtml" > id="configureobjects" > > action="DoConfigureObjects"> <s:label > theme="xhtml" label="Name" > > name="Name" /> <s:hidden > name="Name" /> <table> > > <tbody> > > <s:iterator value="DataObjects" > var="CurrentObject"> > > <tr> > > <td> > > <s:property > value="CurrentObject.Property1" /> > > <s:hidden > name="CurrentObject.Property1" > > value="CurrentObject.Property1" /> > > </td> > > <td> > > <s:textfield > name="CurrentObject.Property2" /> > > </td> > > <td> > > <s:textfield > name="CurrentObject.Property3" /> > > </td> > > </tr> > > </s:iterator> > > </tbody> > > </table> > > <sx:submit label="Configure" /> > > </s:form> > > > > What am I doing wrong? > > > > Thanks in advance, > > > > Matt Kleiderman > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > -- > Nikhil > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]