JSF/PrimeFaces 中有数据网格组件吗?
我需要一个像
这样的迭代组件,它在每次迭代时生成
元素并添加分页。类似带有分页的
。它存在于 PrimeFaces 或任何其他库中吗?
I need an iterating component like a <h:datatable>
which generates <div>
elements on every iteration and adds pagination. Something like an <ui:repeat>
with pagination.
Does it exist in PrimeFaces or any other library?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 PrimeFaces 中的 p:dataTable 元素可以满足您的需求。它绘制一个具有第一个/先前/下一个/最后一个控制语义的分页面板。这是分页的示例。
我最推荐的是他们的“延迟数据表加载”模式,在这种模式下,您不会将任何实际上不会显示的数据从服务器传输到客户端。通过这种方式,您可以处理具有数百万条记录的数据源。这是延迟数据加载的示例。
如果您想要网格而不是表格,我认为 PrimeFaces p:dataGrid 实现是业内最好的。不幸的是,我自己的应用程序不使用它,但示例是此处 。
I think the p:dataTable element in PrimeFaces does what you want. It draws a pagination panel with first/prior/next/last control semantics. Here is the example for pagination.
What I recommend most is their "lazy data table loading" mode where you do not transfer any data from the server to the client that is not actually going to be displayed. In this way you can handle a data source with millions of records. Here is the example for lazy data loading.
If you want a grid and not a table, I think the PrimeFaces p:dataGrid implementation is the best in the business. Unfortunately my own application doesn't use it, but the example is here.