struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Morris" <>
Subject RE: Dynamic Forms
Date Fri, 21 Jun 2002 17:17:38 GMT

It is pretty simple. The following should work. 

ArrayList dynValues = new ArrayList();
public ArrayList getDynValues() {
  return dynValues;
public void setDynValues(ArrayList dynValues)
  this.dynValues = dynValues;

For the example I gave was simplified. I always use 
a bean for updatable properties so on my form I declare 
that bean, which contains the ArrayList and has the 
actual getter and setter. If that bean is named someBean 
on the form, the nested:iterate tag property is actually 
something like property="someBean.dynValues".

David Morris

>>> 06/21/02 01:34AM >>>

This is probably a very newbie question, but how are you gonna define
your getters and setters in your form bean?


-----Original Message-----
From: David Morris [] 
Sent: Thursday, June 20, 2002 7:49 PM
Subject: RE: Dynamic Forms


Would it work to store your property name/values pairs 
in an arrayList and then use iterate or the nested tags 
to loop through the values when you display them? The 
generated text tag would then be something like 
property="dynValues[0].value" value="Some Value". You 
would build the arrayList of dynProps each one having a 
value, name pair.

  <nested:root name="yourBeanIfNotOnForm">
    <nested:iterate property="dynValues">
      <tr><td><nested:text property="value"/></td></tr>

David Morris

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message