karolkpl
karolkpl

Reputation: 2209

jsf ui:repeat with multiple items in row

Is it possible to iterate over collection and display multiple items in a row? Something like:

<ui:repeat value="#{c.images}" var="img" step="3">
#{img} #{img+1} #{img+2}<br/><br/>
</ui:repeat>

Upvotes: 1

Views: 2911

Answers (1)

Thomas
Thomas

Reputation: 88707

Why don't you iterate over the list and add the <br/><br/> for every index where index % 3 == 0 ?

Alternatively, if you are using RichFaces, you could try and use its datagrid:

<rich:dataGrid 
  value="#{c.images}" 
  columns="3">
...

Upvotes: 2

Related Questions