collecting parameters from a dynamic form
I have a dynamic form that is built from an ArrayList of objects (see below (b) ). Building the form works great. I get multiple rows of widget names and values. However, I can't seem to collect the data in my Action. The HTML that is rendered just repeats the same named input fields (see below (b)). In my action, my widget ArrayList comes in with the right number of objects, but they are blank (no data has been collected from the form). A request.getParameter(name)); request.getParameter(value)); works, but of course only returns one of the sets of data - the first in the form. So I can't seem to retrieve the multiple values from in my Action class in any way. Am I doing something that can't be done? (a) input type=text name=name input type=text name=value input type=text name=name input type=text name=value (b) html:form action=/saveWidgets logic:iterate id=element name=widgetForm property=widgets table tr th Widget Name /th td html:text name=element property=name /td /tr tr th Widget Value /th td html:text name=element property=value /td /tr /logic:iterate /html:form Thanks Jeff http://www.xns.org/=jeffoberlander -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: collecting parameters from a dynamic form
The issue is one of distinct element names when you use an iterator to create your form. I found the solution by way of the indexed=true property of html:text It produces a parameter name of element[0].name - where element is the name given to the iterator object and the bracket represents the index of the iterator. Apparently this is new though because I had to install the nightly build in order to use it. Jeff -Original Message- From: Marcus Brito [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 10:40 AM To: Struts Users Mailing List Subject: Re: collecting parameters from a dynamic form Em Seg, 2002-02-04 às 14:11, Jeff Oberlander escreveu: request.getParameter(name)); request.getParameter(value)); works, but of course only returns one of the sets of data - the first in the form. Take a look at the HttpServletRequest API. If you need to get multiple values for a parameter, you need to use the getParameterValues() method. -- Ja ne, Pazu mailto: [EMAIL PROTECTED] Anime Gaiden: de fãs para fãs, sempre. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]