Efficient JSF Pagination

后端 未结 4 658
谎友^
谎友^ 2020-12-06 11:23

Whats the most efficient way of doing pagination in JSF 2.0 app? I use Primefaces datatable and it is intelligent enough to perform pagination by itself with no coding at al

4条回答
  •  抹茶落季
    2020-12-06 11:45

    You need to use LazyDataModel in order to have only the rows in memory which the client actually needs to see. See also the example in PrimeFaces showcase. This does pagination at DB level which is what you ultimately want.

    RichFaces supports by the way the same in flavor of ArrangableDataModel, here's the RichFaces showcase example.

提交回复
热议问题