Primefaces: set page on datatable
2014-10-21 17:15
127 查看
In your managed bean you can try this code:
Call this method when you add a new row
public void setPageDataTable() { final DataTable d = (DataTable) FacesContext.getCurrentInstance().getViewRoot() .findComponent("form:templateTable"); int first = 1; if (d.getRowCount() % ROWS_DATATABLE == 0) { first = (d.getRowCount() - ROWS_DATATABLE); } else { first = (d.getRowCount()/ROWS_DATATABLE)*ROWS_DATATABLE; } d.setFirst(first); }
Call this method when you add a new row
相关文章推荐
- Primefaces: How to set page on datatable after inserting a new row
- ViewPager的setOnPageChangeListener方法详解
- ViewPager的setOnPageChangeListener方法详解
- 安卓之SetOnPageChangeListener
- Viewpager的setOnPageChangeListener方法详解
- How to set the DefaultButton in a Page Based on ASP.NET Master Page
- ViewPager的setOnPageChangeListener方法详解
- setOnPageChangeListener 被改成了 addOnPageChangeListener
- [Android分享] ViewPager的setOnPageChangeListener方法详解
- ViewPager的setOnPageChangeListener方法详解
- setOnPageChangeListener 过时
- ViewPager的setOnPageChangeListener方法详解
- ViewPager的setOnPageChangeListener()弃用后代替的新方法的使用
- ViewPager的setOnPageChangeListener的三个方法的执行顺序
- Android setOnPageChangeListener 过时了怎么办?
- ViewPager的setOnPageChangeListener方法详解
- setOnPageChangeListener 过时了怎么办?
- setOnPageChangeListener 过时==>改成addOnPageChangeListener
- ViewPager的setOnPageChangeListener方法详解
- viewpager.setOnPageChangeListener中方法的参数详解