I\'ve a datatable in primefaces and I want, when I add a row in it, view the last page of the datatable.
My .xhtml page is:
...
I would do it without any JavaScript. Primefaces's datatable has a first
attribute, which is the index of the first data to display.
...
And your backing bean:
public class CalculatePageTable {
private int first = 1;
public int getFirst(){
return first;
}
public void addRow(){
// 1. your stuff for adding the row
...
// 2. switch to the row
first = getFirstRowOnLastPage();
}
private int getFirstRowOnLastPage(){
...
}
}