This content has been marked as final.
Show 2 replies
-
1. Re: sorting and exporting from a rich-datatable
maxmustang Feb 6, 2009 5:14 AM (in response to janson12)Hi Janson,
Did you find a solution? I need exactly the same.
Greetings MAx -
2. Re: sorting and exporting from a rich-datatable
maxmustang Feb 10, 2009 12:17 PM (in response to janson12)ok i found a solution that works for me:
Getting Table from the GUI as it is sorted on the GUI:
import org. richfaces.component.html .HtmlDataTable;
HtmlDataTable personsTable = (HtmlDataTable)FacesContext.getCurrentInstance().getViewRoot().findComponent("form1:persons");
for (int i = 0; i < personsTable.getRowCount(); i++) {
//loop over the rows
personsTable.setRowIndex(i);
//get the values from row and add it a Person-Bean
Person person = (Person) personsTable.getRowData();
// Add the person to a List for further needs f.i. a pdf
persons.add(person);
}