i need to collect homework scores of students in a class. what i have done so far is
- get the list of student ids
using ui:repeat i loop thru the list and for each student id, i
2a)display an h:inputText whose value is the current student id, then
2b)to the right of textbox in (2a) above, i display another h:inputText for the teacher to enter the score for that student(for now that value is a dummy variable just to get the page to display).
- i have a single commandbutton to submit all the data.
For example, if i have 20 students, i would have 20 rows, where each row has two h:inputText, one already containing the current student_id and the other is empty for the teacher to type the score.
How can i collect these values correctly, so that the right student id is linked to the right score.
Note that i cant hardcode the number of textfields cos the number of students in a class can change at any time.