Ok I tried that and a couple of more things. I can see what Kishore
trying to do, using indexed properties. However using login iterate
loop with indexed property didnt work and I was getting: cannot find
fields[0].label in the bean. So I replaced that with <nested:iterate
like so:

       <nested:iterate name="formActionForm" property="fields" >
       <tr>
         <td><nested:text property="label"/></td>
                 <td><nested:text property="fields"/></td>
       </tr>
       </nested:iterate>
It does the same thing by outputting inputs name as: fields[0].label

However, it still doesnt change the ActionForms property on submit, I
do have in my bean method defined as

 public ArrayList getFields() {
   return fields;
 }

 public void setFields(ArrayList fields) {
   this.fields = fields;
 }


Thanks Dakota for your input as well, I see what you mean and I tried
doing what you suggested and it didnt work, most likely due to the
fact that all the fileds like label, type, .... belong to a Bean, and
my ActionForm has a list populated with those Beans, as wel as
getter/setter for a hole List but getters and setters for the
label,type,.... are within the Bean rather than ActonForm.

Still stuck guys, what else can I try?

Thanks,
Oleg



On Sat, 15 Jan 2005 04:26:21 -0800, Dakota Jack <[EMAIL PROTECTED]> wrote:
> I don't know what Kishore is talking about.  Seems what you do is
> better than that suggestion.  However, if you want the field from the
> form saved, populated, etc., all you have to do is have a property for
> the field, e.g.
> 
> protected String field;
> 
> public String getField() { return field; {
> public void setField(String field) { this.field = field; }
> 
> You have to also do whatever you want with the reset(), in the Action
> class, etc.
> 
> Jack
> 
> 
> On Fri, 14 Jan 2005 23:20:47 -0800, Oleg <[EMAIL PROTECTED]> wrote:
> > Hi, ok I am trying to get my Dynamic List-Backed form to work, no
> > luck, here is what I have so far.
> >
> > ActionForm with a List in it:
> >
> >   public ArrayList getFields() {
> >     return fields;
> >   }
> >
> >   public void setFields(ArrayList fields) {
> >     this.fields = fields;
> >   }
> >
> > Now, a field itslelf is a bean:
> >
> > public class FormField {
> >   private String label;
> >   private String name;
> >   private String value;
> >   private String type;
> >   private java.util.ArrayList props;
> >   private boolean required;
> >  .......................
> > getter and setters here
> > }
> >
> > There is an Action that gets the info from the database and populates
> > into the ActionForm, no problem. Now Jsp page has something like this:
> >
> >         <c:forEach items="${formActionForm.fields}" var="field">
> >         <tr>
> >           <td><html:text property="label" name="field"/></td>
> >           <td>
> >             <html:select property="type" name="field">
> >                 <html:optionsCollection name="definitionFields"/>
> >             </html:select>
> >           </td>
> >                 /////           and so on for all the properties
> >         </tr>
> >         </c:forEach>
> >
> > So my question is, how do I make it so when this values are changed
> > and submitted they are changed in the ActionForm ?? IS there a way to
> > have that happen automatically like with a normal actionform or I have
> > to do it programatically?
> >
> > I am really stuck here!!!
> >
> > Oleg
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> ------------------------------
> 
> "You can lead a horse to water but you cannot make it float on its back."
> 
> ~Dakota Jack~
> 
> "You can't wake a person who is pretending to be asleep."
> 
> ~Native Proverb~
> 
> "Each man is good in His sight. It is not necessary for eagles to be crows."
> 
> ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> 
> -----------------------------------------------
> 
> "This message may contain confidential and/or privileged information.
> If you are not the addressee or authorized to receive this for the
> addressee, you must not use, copy, disclose, or take any action based
> on this message or any information herein. If you have received this
> message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation."
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to