views:

280

answers:

1

Hi, i've been trying to add a pager to a dynamic datatable.

I am using the BalusC code at :http://balusc.blogspot.com/2006/06/using-datatables.html

Dynamic columns are working great, but now i need to programatically add a simple pager to allow the user to scroll through the records.

I'm using jsf-ibm components, where there exists a pager component, but i've been checking the api's and can't find the right way to add it to the HtmlDataTableEx component.

Any suggestion will be apreciated.

A: 

nevermind, i found the way, in case someone reaches this question:

HtmlDataTableEx table = new HtmlDataTableEx();

// all your column setttings here...

HtmlPagerGoto pager = new HtmlPagerGoto(); //you can use web or deluxe too... pager.setId("tablaPager"); pager.setFor("tablaReporte"); pager.setStyleClass("tablaPagerClass");

HtmlOutputStatistics statistics = new HtmlOutputStatistics(); statistics.setId("tablaStatistics"); statistics.setFor("tablaReporte"); statistics.setStyleClass("tablaStatisticsClass");

HtmlPanelGroup header = new HtmlPanelGroup(); header.getChildren().add(statistics); header.getChildren().add(pager);

table.setHeader(header); //this can be in the footer too

rafa colunga