Hi all
I'm having a little bit of trouble with this one. The problem is that I have a datatable and its contents is made of columns and I can't figure out how to reRender a single column. Here's a little example
<rich:dataTable id="studentsTable" value="#{mbean.students}" var="student">
<f:facet name="header">
<rich:columnGroup>
<rich:columns value="#{student.classes}" var="class" index="index">
<rich:dropDownMenu event="onmouseover" jointPoint="bl" submitMode="ajax" value="#{class.date}" >
<rich:menuItem action="#{mbean.toggleSelection(index)}" reRender="studentsTable" value="Toggle Selection" ajaxSingle="true"/>
</rich:dropDownMenu>
</rich:columns> </rich:columnGroup>
</f:facet>
<rich:columns value="#{student.classes}" var="class" >
<a4j:outputPanel>
<h:selectBooleanCheckbox value="#{class.attendedClass}"/>
</a4j:outputPanel>
</rich:columns>
</rich:dataTable>
and in the ManagedBean:
private List<Student> students;
public List<Student> getStudents() {
return students;
}
public void toggleSelection(Integer index) {
for (Student student : students)
student.getClasses().get(index).setAtendedClass(!student.getClasses().get(index).isAttendedClass());
}
The code above works, but rerender the whole table makes it really slow when I have many checkboxes on it. I've already tried to specify dynamic ids to the columns with its index and rerender it, but it only works before the first rerender.