You are absolutely right and I finally got it dsiplaying the way I want it, still on submit I get
java.lang.NullPointerException org.apache.commons.beanutils.PropertyUtils.getIndexedProperty On Sat, 15 Jan 2005 15:23:20 -0800, Dakota Jack <[EMAIL PROTECTED]> wrote: > If you have a select, you don't want an ArrayList from request scope. > You want the value selected to be the value of the option name. > Right? > > Also, you can do indexed properties with JSTL. > > Jack > > > On Sat, 15 Jan 2005 14:31:27 -0800, Oleg <[EMAIL PROTECTED]> wrote: > > Ok I got I think, the problem is, silly of me to miss it, is that the > > action to which I am posting using a different ActionForm :) that > > would screw things up :)/ > > > > Problem is that I have to use that ActionForm, so now I have to do it > > porgrammatically, but from what I understand I cant get an ArrayList > > from request scope. Any ideas how would I get the ArrayList of fields > > after from is posted and populate ActionForm manually? > > > > Oleg > > > > > > On Sat, 15 Jan 2005 02:37:28 -0600, Kishore Senji <[EMAIL PROTECTED]> wrote: > > > Sorry forgot to tack on the actual property > > > > > > <logic:iterate name="formActionForm" property="fields" indexId="index" > > > id="field"> > > > <tr> > > > <td> > > > <html:text property='<%="fields["+index.intValue()+"].label"%>'/> > > > </td> > > > <td> > > > <html:select property='<%=fields["+index.intValue()+"].type%>'> > > > <html:optionsCollection name="definitionFields"/> > > > </html:select> > > > </td> > > > /// similarly for other fields > > > </tr> > > > </logic:iterate> > > > > > > On Sat, 15 Jan 2005 02:32:48 -0600, Kishore Senji <[EMAIL PROTECTED]> > > > wrote: > > > > 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> > > > > > > > > > > > > > Try something like this; > > > > > > > > <logic:iterate name="formActionForm" property="fields" indexId="index" > > > > id="field"> > > > > <tr> > > > > <td> > > > > <html:text property='<%="fields["+index.intValue()+"]"%>'/> > > > > </td> > > > > <td> > > > > <html:select property='<%=fields["+index.intValue()+"]%>'> > > > > <html:optionsCollection name="definitionFields"/> > > > > </html:select> > > > > </td> > > > > /// similarly for other fields > > > > </tr> > > > > </logic:iterate> > > > > > > > > The trick is to start from the form level and adjusting the property > > > > accordingly. > > > > > > > > for more info: http://struts.apache.org/faqs/indexedprops.html > > > > > > > > > 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] > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > 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]