【问题标题】:rich:dataList pagination?丰富:数据列表分页?
【发布时间】:2010-08-02 01:04:16
【问题描述】:

我知道当你想在 <rich:dataTable> 上分页时,你可以使用 <rich:datascroller>。但是,<rich:dataList><rich:dataOrderedList> 呢?这些组件是否有任何分页机制?还是我必须手动编写逻辑代码?

【问题讨论】:

    标签: ajax list jsf pagination richfaces


    【解决方案1】:

    没有任何地方说<rich:datascroller> 只适用于<rich:dataTable>。所以我假设它适用于大多数迭代标签 - 试试吧。

    如果由于某种原因没有,您可以使用表格(使用适当的 css)轻松模拟列表的外观

    【讨论】:

    • 你说得对。尽管 RichFaces 文档暗示它只能与数据表一起使用,但我在“Practical RichFaces”一书中找到了一个示例,该示例显示它与数据列表一起使用。谢谢!!
    【解决方案2】:

    构建自己的 dataScroller 将非常容易。 您可以在<rich:dataList> 组件上使用 first 和 rows 属性。

    要完成这项任务,您所要做的就是编写一个处理属性值的 bean

    <rich:dataList id="myList" first="#{dataScrollerBean.first}" rows="#{dataScrollerBean.rows}">
    <a4j:commandButton action="#{dataScrollerBean.prev}" value="< Prev" reRender="myList"/>
    <a4j:commandButton action="#{dataScrollerBean.next}" value="Next >" reRender="myList"/>
    

    【讨论】:

      猜你喜欢
      • 2011-08-19
      • 2011-02-11
      • 2010-12-14
      • 2012-01-22
      • 2014-07-09
      • 1970-01-01
      • 2011-01-28
      • 1970-01-01
      相关资源
      最近更新 更多