Sometimes Xpages drives me insane. So many easy things (things that should be easy anyway) are hard.
Simple questions, how do I display multi-value fields with new line in Xpages view Column?
Sometimes Xpages drives me insane. So many easy things (things that should be easy anyway) are hard.
Simple questions, how do I display multi-value fields with new line in Xpages view Column?
There's ways to do it with computed controls, where you explode the array and add a
and stuff like that.
Personally I like to just use a repeat control. Set the field as the repeat value. Add a computed control for the "rowData" and add a
if you want a new line between each of them. I'm sure I did this on an early NotesIn9 though I forget which one at the moment.
the key is this. a Repeat control can repeat or "iterate" over any type of array or "multi-value" object.
It's always better and easy to use view control for categorized views rather than repeat controls. To display multi-value field in view column you have to set content type as HTML then just replace commas with <br>
tag. And it works exactly as you want.
<xp:viewColumn columnName="$3" id="viewColumn3" contentType="html">
<xp:this.converter>
<xp:customConverter getAsObject="#{javascript:value}">
<xp:this.getAsString><![CDATA[#{javascript:@Implode(value, '<br>')}]]></xp:this.getAsString>
</xp:customConverter>
</xp:this.converter>
<xp:viewColumnHeader value="ColumnHeader" id="viewColumnHeader3">
</xp:viewColumnHeader>
</xp:viewColumn>