JSF ui:repeat vs h:dataTable

孤街醉人 提交于 2019-11-30 21:53:43

is there any use cases where the only choice is to use h:dataTable?

  • If you want to use an UIData-based component (with all of its special attributes absent in UIRepeat).
  • If you want to render a HTML <table> by a JSF component.
  • If you want to be able to customize the <table> rendering (like PrimeFaces <p:dataTable> does with sorting, filtering, grouping, folding, lazyloading, etc, etc).
  • If you aren't using Facelets as view technology.

or the opposite (only choice is ui:repeat)?

  • If you don't want any of above and thus need a pure markup-less iteration component.
  • If you want to be able to skip every n items during iteration (using step attribute).