tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David M. Holmes" <david_m_hol...@yahoo.com>
Subject RE: setProperty and arrays
Date Thu, 20 Jul 2000 17:18:13 GMT
I'm not exactly sure what you are looking for but if
you have multiple form elements with the same name
then there will be one call to setElementName() with
an array of the values passed to it.

String grades[];

public setGrades(String[] grades) {
  this.grades = grades;
}


--- Bob Byron <bbyron@MailAndNews.com> wrote:
> Thank you all for your responses.  I do understand
> the concepts laid out in 
> the Advanced Forms Processing article, however, I am
> going to the next step, 
> and that is in addition to asking for first name,
> last name, middle initial, 
> etc.  I am also wanting to process arrays in a form.
>  That is, suppose the 
> above person is a teacher and he has about 30
> students in his class.  I want 
> to display the teachers name and list the students. 
> I will produce the 
> student list with a query and loop through the
> result set generating my JSP 
> code.  Let us further suppose, I want to put an
> entry field next to each 
> students name so that I can enter a letter grade. 
> The LastName setProperty 
> will call setLastName, but what does the
> setStudentGrade do?  I don't want to 
> write setStudentGrade_001, setStudentGrade_002
> methods.  What I need is for 
> setStudentGrade to be called with two parameters
> setStudentGrade(offset,grade) 
> or something like that.  I know other people have
> done ARRAY processing and am 
> interested in their techniques.
> 
> Example:
> 
> LastName: smith    FirstName:   joe    MI:  m
> Student  1:         StudentGrade: <INPUT GRADE>
> Student  2:         StudentGrade: <INPUT GRADE>
> Student  3:         StudentGrade: <INPUT GRADE>
> Student  4:         StudentGrade: <INPUT GRADE>
> ...
> Student 30:         StudentGrade: <INPUT GRADE>
> 
> 
> >===== Original Message From Mike Lazlo
> <mlazlo@ndc-nfi.com> =====
> >This article may help,
>
>http://www.javaworld.com/javaworld/jw-03-2000/jw-0331-ssj-forms_p.html
> >
> >
> >Bob Byron wrote:
> >
> >> I am developing a form that dynamically generates
> a number of rows.  These
> >> rows contain inputs.  I was wondering how to
> utilize the setProperty method
> >> to post my data?  As an example:
> >> (The table rows would be generated by a loop)
> >> <form>
> >>   <table>
> >>     <tr><td><input type="text"
> id="somename"></td></tr>
> >>     <tr><td><input type="text"
> id="somename"></td></tr>
> >>     <tr><td><input type="text"
> id="somename"></td></tr>
> >>     <tr><td><input type="text"
> id="somename"></td></tr>
> >>     <tr><td><input type="text"
> id="somename"></td></tr>
> >>   </table>
> >> </form>
> >>
> >> So, how do I best process "somename"?  Will my
> setSomename method be called
> >> once for each input?  Should I make the names
> more unique like
> >> "somename_001", "somename_002", "somename_003",
> etc.  Any advice on your
> >> techniques would be appreciated.
> >>
> >> Thank You,
> >> Bob Byron
> >> RAD Systems, Inc.
> >> www.radit.com
> >> (972)516-4256
> >
> >--
> >\\\\\\\\\\\\\\\\\\\\\\\\\\\\
> >/        Mike Lazlo        /
> >\  Technical Manager/DBA   \
> >/    mlazlo@ndc-nfi.com    /
> >\ 1-800-922-5088 ext. 4758 \
> >////////////////////////////
> 
>
------------------------------------------------------------
> Bob Byron
> RAD Systems, Inc.
> (972)516-4256
> 


__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail  Free email you can access from anywhere!
http://mail.yahoo.com/

Mime
View raw message