URGENT JSP/Struts/Java Question
Posted on 2003-11-14
I am working on a Diary Page for a client seeing a personal trainer.
I display a table of repeating values which shows line after line of exercise
details (name of exercise, expected reps, expected sets, expected weight lifted) and also on the line are textboxes for a client to fill in - (actual reps, actual sets, actual weight lifted).
These values are all displayed directly from the database and the textboxes holding the actual values are shown initially as 0 before the client completes them all and clicks submit to write their actual results to the database.
As I create each row I am storing a hidden value called workoutExerciseId and this is printing out correctly when I test with a text box, however when I write the values back, all the values in the first line are all writing the same to every other line in the database. (Eg: I have lines of workoutExerciseId 1,2,3,4,5,6 - then every line is written as the values I input for id 1 so obviously in my code this first number is sticking).
What is the best way to attack this (other than putting a submit button on every line)?