Im still having problems getting this.  I just started using struts so
please bear with me here.  But can someone please email me something similar
to the logic-iterate example that cmoes with the example-taglibs demo ?  I
am getting null pointer errors and I dont if it is my struts distribution or
my own inability to grock this....

i will try not to toxify this list with any more of this ....  its just that
if I cant model a formbean w/a grid of data struts is worthless to me,
because my whole world is executing functions w/import tables.

-paul
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 1:54 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: multiple form fields




Paul,

a concrete example using modified tag:

jsp:
      <logic:iterate id="parameter" name="ParametersForm"
property="parameterList">
     .................
            <html:text name="parameter" property="value" indexed="true"
onchange="validate(this)"/>
     .................
      </logic:iterate>


in my form bean (using a vector):

public final class ParametersForm extends ActionForm
{
   /**
    * The parameter list
    */
   private Vector parameterList = new Vector();


   /**
    * Return the list of parameters
    */
   public Vector getParameterList()
   {
      return(this.parameterList);
   }

   /**
    * Set the list of parameters
    *
    * @param parameterList The new list
    */
   public void setParameterList(Vector parameterList)
   {
      this.parameterList = parameterList;
   }

   /**
    * Get a particular parameter from the parameterList, based on index
    *
    * @param   index The index of the parameter to retrieve
    */
   public Parameter getParameter(int index)
   {
      return (Parameter)parameterList.elementAt(index);

   }
}

Hope that helps,

Dave





"Paul Beer" <[EMAIL PROTECTED]> on 06/28/2001
02:32:55 PM

Please respond to [EMAIL PROTECTED];
Please
      respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: David Hay/Lex/Lexmark)
Subject:  RE: multiple form fields



sorry i send the email accidently :

doesnt :

  ...
    <INPUT type="text" name="qty" value="1">
    <INPUT type="text" name="qty" value="2">
    <INPUT type="text" name="qty" value="3">
    ...

In your class:

    String[] qtys = request.getParameterValues("qty");


defeat the purpose of having a form bean which seems like a kind of servlet
abstraction of an html form ?  i dont really care.  I would just like to see
some sample code that works.  I have searched through the quagmire that is
the mail archives and every thread ends w/confusing comments.

-p










Reply via email to