Sorry for an ambiguity that was in my example.

here are the gory details :)

I am only using student as an example the real object would only complicate matters.

In an action I am retrieving :

- a list of all the students objects. This includes their student id.

- an array of studentsGrade objects. These objects have a studentId, semester1Grade, semester2Grade in them. Remember that there might be, at most, the same amount of studentGrade objects as there are students. It is the case where there are less that I am concerned in.

In the jsp :

I only what the form to create text fields for the student if there was data found. This may seem strange but there is a good business reason for this.

I need the full list of students to be displayed in the page. With out this everything works great. The list of students is also ordered.

Last ditch effort,
Nathan

On Feb 10, 2004, at 11:43 AM, Michael McGrady wrote:

Hi, Nathan:

This is progress, but I cannot tell what "Since the index from the outside <foreach> will not work for the indexed properties first and last name" means. Please clarify.

So far I can tell only the following: you have a list of students identified only by first and last name. You want to have a form that gets some more information, i.e. a third bit of information, from them via a text field.

There are various reasons why what you are writing is hard to read. Your examples indicate a reality which is unlikely to be true, e.g. you have all the students with the same name such a "Joe Schmoe". You apparently are using A, B, etc. to stand in for what you call a NameId. If that is true or not is impossible to tell.

Let me try to understand what you want to do. Do you merely want to update student names when you have them stored under student ids? I really cannot tell what you want to do. Whatever you want to do can easily be done, I am sure. It is really hard to tell what you want done. If you are trying to update names alone, then how are you doing this. Are the students doing it? Is an administrator doing it? Is the problem that there are too many students for one page? Is the problem that you don't have them indexed by name? If they are indexed by id, and there are a known number, you an create a Map with the students and use the id as an indexed property to retrieve the students. But, again, your explanation is not readable for me. So, I don't know what you want to do. Want to try again?

Michael

Michael

At 07:52 AM 2/10/2004, you wrote:
First thanks for your time trying to help me.

Here is the deal....

I have a list of elements.

Name    Id
Student A       123
Student B 123
Student C 123
Student D 123
Student E 123
Student F 123

and I only have data (first & last name) for some random amount of them. On these rows I want the form to create text fields for these items.

Student A
Student B               joe     schmoe
Student C
Student D               joe     schmoe
Student E               joe     schmoe
Student F

Since the index from the outside <foreach> will not work for the indexed properties first and last name I believe that I will have to test if the current student row is equal to the next row in the array of data. If they are then I will have to create the <html:text> by hand.

Nathan Maves
Sun Microsystems




On Feb 10, 2004, at 1:40 AM, Villalba Arias, Fredy [BILBOMATICA] wrote:


Hi,

I don't know about indexes, but I can think of a simple solution, Struts-independent (well, not 100%): have all values concatenated in a single "hidden" attribute that get's submitted, using different tokens for separating different values and for separating different records (by record I mean a set of values). Then it's just about parsing it (the value stored on the corresponding property) on the server side. I know It's not the most "elegant" solution, but it you are short of time, then it will surely do it.

HTH,
Freddy.

-----Mensaje original-----
De: Nathan Maves [mailto:[EMAIL PROTECTED]
Enviado el: martes, 10 de febrero de 2004 1:24
Para: Struts Users Mailing List
Asunto: dynamic parameters

I have searched but found nothing on this specific example.

I have a form that will have n number of elements.  Each of these
elements will needs it own name.

example.

list of students is displayed on the screen with two text fields for
their first and last name.

This is for a mass update page.

The only way I can thing of is to have form element like..

<text name="#student_id#-#first_name#">
<text name="#student_id#-#last_name#">

This way in my action I can parse out the student id and then update
the corresponding first and last name.

Can this be done or is there a better way to do it.


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


--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003


--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003


--------------------------------------------------------------------- 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]



--------------------------------------------------------------------- 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]



Reply via email to