datatable paginator setFirst not working

2019-08-20 04:24发布

I have the following problem:

In one of my sites I have a Datatable. If i click on an Entry I am getting to a different page. If i go back to the page before I want to have the Datatable be on the same page it was when I clicked the row. I am able to set the page with the page event.

I am also able to get inside a method where I would like to set the page. The code inside looks like this:

final DataTable d = (DataTable) FacesContext.getCurrentInstance()
            .getViewRoot().findComponent("form:persons");
if (d != null) {
    d.setFirst(currentPage);
}

This should do the job I think, but nothing is happening to the datatable. Am I doing anything wrong? In what phase should I set the page?

0条回答
登录 后发表回答