Reputation: 325
I need to iterate over all the row data programmatically. Once I have the org.primefaces.component.datatable.DataTable object, I can get the content of the current row using #getRowData(). #getColumns().getChildren() returns a List which has only one UiComponent, that too of row 1.
What is the correct way of iterating through the row datas?
Solved Using dataTable.setRowIndex(rowIndex), one can fetch columns from a particular row.
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) {
table.setRowIndex(rowIndex);
columns = table.getColumns();
// Your Code Goes Here
}
Upvotes: 1
Views: 2346
Reputation: 325
Solved Using dataTable.setRowIndex(rowIndex), one can fetch columns from a particular row.
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) {
table.setRowIndex(rowIndex);
columns = table.getColumns();
// Your Code Goes Here
}
Upvotes: 1