I am working on a grading program with jsf and hibernate. I have a list of students and a list of criteria for calculations. The criteria list is variable and can be modified by a teacher... I was wondering how I can manage to do the set all grades for all students in a request. Let's say there is Student A and B with criterias X and Y. It should show a table
+---------------------------------------------------+
| Student | Criteria X | Criteria Y |
+-----------+-------------------+-------------------+
| A | [input for grade] | [input for grade] |
+-----------+-------------------+-------------------+
| B | [input for grade] | [input for grade] |
+---------------------------------------------------+
I can do that, so far, but the input for grade has not a target in the controller bean since it can't be only student A and B, but could have more/les, same with criteria. I'd love an idea to manage it.
In PHP, I'd work with the Post global variable and fetch this array to get student/criteria from input name and save that grade with the corresponding student/criteria.
JSF - 2.0
[Update 1]
<table border="1">
<thead>
<tr>
<th>Nombres y apellidos</th>
<ui:repeat value="#{cursoController.grupo.criterios.toArray()}" var="criterio">
<th>#{criterio.criterioNombre}</th>
</ui:repeat>
</tr>
</thead>
<tbody>
<ui:repeat value="#{cursoController.grupo.matriculas.toArray()}" var="matricula">
<h:form rendered="#{matricula.rol.perfil.idPerfil == 69}">
<tr>
<td>
<h:inputHidden value="#{matricula.rol.idRol}"/>
#{matricula.rol.usuario.persona.personaNombre}
</td>
<ui:repeat value="#{cursoController.grupo.criterios.toArray()}" var="criterio">
<td>
<h:inputText style="width: 70px;"/>
</td>
</ui:repeat>
</tr>
</h:form>
</ui:repeat>
</tbody>
</table>