开发者

how to add a pager to dynamic datatable in jsf 1.1

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜