struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Oberlander <Jeff.Oberlan...@onename.com>
Subject collecting parameters from a dynamic form
Date Mon, 04 Feb 2002 16:11:08 GMT
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:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message