voyent
Paginator on the fly  XML
Forum Index -> Components
Author Message
pbk97030

Joined: 04/Oct/2007 00:00:00
Messages: 17
Offline


I am creating a table dynamically. Everything but page information about index/count works.

Please refer to the attachment.
Thanks,


Code:
  DataPaginator paginator2 = createDataPaginatorDisplayInfo();
  paginator2.setFor("meteringReconBean");
  panelGrid.getChildren().add(paginator2);
 
 
  private DataPaginator createDataPaginatorDisplayInfo()
     {
             DataPaginator dataPaginator=new DataPaginator();
             dataPaginator.setPaginator(true);
             dataPaginator.setFor("meteringReconBean");
             dataPaginator.setId("dataScroll_2");
             dataPaginator.setRowsCountVar("rowsCount");
             dataPaginator.setDisplayedRowsCountVar("displayedRowsCount");
             dataPaginator.setFirstRowIndexVar("firstRowIndex");
             dataPaginator.setLastRowIndexVar("lastRowIndex");
             dataPaginator.setPageCountVar("pageCount");
             dataPaginator.setPageIndexVar("pageIndex");
     
             HtmlOutputFormat of=new HtmlOutputFormat();
             of.setId(FacesContext.getCurrentInstance().getViewRoot().createUniqueId());
             of.setStyleClass("standard");
             of.setValue("{0} items found, displaying {1} item(s), from {2} to {3}. Page {4} / {5}.");
     
             UIParameter paramrowsCount=new UIParameter();
             paramrowsCount.setId(FacesContext.getCurrentInstance().getViewRoot().createUniqueId());
             paramrowsCount.setValue("#{rowsCount}");
             of.getChildren().add(paramrowsCount);
     
             UIParameter paramdisplayedRowsCount=new UIParameter();
             paramdisplayedRowsCount.setId(FacesContext.getCurrentInstance().getViewRoot().createUniqueId());
             paramdisplayedRowsCount.setValue("#{displayedRowsCount}");
             of.getChildren().add(paramdisplayedRowsCount);
     
             UIParameter paramfirstRowIndex=new UIParameter();
             paramfirstRowIndex.setId(FacesContext.getCurrentInstance().getViewRoot().createUniqueId());
             paramfirstRowIndex.setValue("#{firstRowIndex}");
             of.getChildren().add(paramfirstRowIndex);
     
             UIParameter paramlastRowIndex=new UIParameter();
             paramlastRowIndex.setId(FacesContext.getCurrentInstance().getViewRoot().createUniqueId());
             paramlastRowIndex.setValue("#{lastRowIndex}");
             of.getChildren().add(paramlastRowIndex);
     
             UIParameter parampageCount=new UIParameter();
             parampageCount.setId(FacesContext.getCurrentInstance().getViewRoot().createUniqueId());
             parampageCount.setValue("#{pageIndex}");
             of.getChildren().add(parampageCount);
     
             UIParameter parampageIndex=new UIParameter();
             parampageIndex.setId(FacesContext.getCurrentInstance().getViewRoot().createUniqueId());
             parampageIndex.setValue("#{pageCount}");
             of.getChildren().add(parampageIndex);    
     
             dataPaginator.getChildren().add(of);    
             return dataPaginator;
     }
 Filename paginator.bmp [Disk] Download
 Description
 Filesize 309 Kbytes
 Downloaded:  172 time(s)

 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team