Primefaces:FacesContext中的分页元素

Primefaces:FacesContext中的分页元素,primefaces,pagination,facescontext,Primefaces,Pagination,Facescontext,我需要帮助。如果有人能帮助我,我将不胜感激 我有一个带有分页的Datatable,我想将paginatorTemplate(RowsPerPageDropdown和CurrentPageReport)中的分页数据放在Datatable之外(在托管Bean中),如何获取它 表的格式如下所示: <h:form id="form"> <p:dataTable id="myDataTable" var="member" value="#bean01MyWorkspaces.dqaS

我需要帮助。如果有人能帮助我,我将不胜感激

我有一个带有分页的Datatable,我想将paginatorTemplate(RowsPerPageDropdown和CurrentPageReport)中的分页数据放在Datatable之外(在托管Bean中),如何获取它

表的格式如下所示:

<h:form id="form"> 
<p:dataTable id="myDataTable" var="member" 
value="#bean01MyWorkspaces.dqaSqlsExecutiveBeanList}" rows="1" paginator="true"
currentPageReportTemplate="Showing {startRecord}-{endRecord} out of {totalRecords}"
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
rowsPerPageTemplate="2,3,4" > ...
如何从bean方法访问RowsPerPageDropdown列表和CurrentPageReport中的实际值/当前值


提前谢谢

在这种情况下,使用DataTable-Lazy代替DataTable-Basic


看看primefaces showcase上的数据表:我想这正是您需要的。非常感谢Jorge。我已经看过你们发送的链接了。这就是我需要的。
<p:commandButton value="User Datasources"
action="#{bean01MyWorkspaces.initDqaSqlsExecutiveBeanList()}"
style="width:100%;height:100%; margin-bottom: 5px"
update="myDataTable"/>
<p:commandButton value="User Datasources 2"
action="#{bean01MyWorkspaces.changeMethod}"
style="width:100%;height:100%; margin-bottom: 5px"
/>
</h:form> 
public void changeMethod() {
    final DataTable d = (DataTable) FacesContext.getCurrentInstance().getViewRoot().findComponent("form:myDataTable");
    int first = 1;
    if(d == null){
        System.out.println("SYSTEM is NULL V"  );
    }else{
        System.out.println("getRowCount is NOT NULL " +d.getRowCount() );
        System.out.println("getCurrentPageReportTemplate is NOT NULL " +d.getCurrentPageReportTemplate());
    }
}