struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farrell, Sarah" <Sarah.Farr...@cccs.cccoes.edu>
Subject repetitive form elements
Date Tue, 12 Feb 2002 15:56:30 GMT


I have a form, lets say it has 3 text input elements across and I have to
repeat this for a total of 10 rows.  So it's something like:

course name            program name          credit hours
course name            program name          credit hours
course name            program name          credit hours
course name            program name          credit hours
course name            program name          credit hours
etc.....

So the form elements are named like: 
courseName1, programName1, creditHours1
courseName2, programName2, creditHours2  etc....

So if I have 10 rows of these, the ActionForm has to have getters and
setters for each of these?

Is there a simpler way of coding this?

I know that struts has an iteration tag but it seems like the "wrong" thing
to use if you aren't doing any database querying when building the form.

I'm going to have to use several web pages with similar forms in my
application and it would be nice if there were a simpler way.

For example, if I were writing it in Perl <ducking> I could append a number
to the variable name in a loop and process everything that way.

As far as I know, there isn't a way to simplify this in Java or Struts.
Right?

Thanks,
Sarah


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message