user2455158
user2455158

Reputation: 97

How to display a comma or semicolon separated list of values

I have a rich faces datatable. I want to display a list of strings in a single cell as comma(or semicolon) seperated values. Is there a way in richfaces to do this?

Upvotes: 2

Views: 2380

Answers (1)

BalusC
BalusC

Reputation: 1108632

Just use <ui:repeat>. You can use varStatus to reference an iteration status instance which has among others a boolean last property which is helpful in omitting the comma from the last item.

<ui:repeat value="#{listOfStrings}" var="string" varStatus="loop">
    #{string}#{not loop.last ? ', ' : ''}
</ui:repeat>

Upvotes: 9

Related Questions