3
votes

There is a column from a view which have the multi-value separator the new line.

enter image description here

But when I drag and drop this view inside my XPage ( as a <xp:viewpanel> ) the multiple values are display within , and not in different lines.

I couldn't find any property in the view column. How can I achive this?

Thanks in advance.

1
Did you try adding a converter of xp:convertList? This is added in the All Properties under data for the view column.Steve Zavocki

1 Answers

10
votes

You have to use customConverter here. Because convertList takes only one character as the seperator.

<xp:viewColumn
    columnName="SomeColumn"
    id="viewColumn1"
    contentType="html">
    <xp:this.converter>
        <xp:customConverter getAsObject="#{javascript:return value;}">
            <xp:this.getAsString>
                <![CDATA[#{javascript:return @Implode(value, "<br/>")}]]>
            </xp:this.getAsString>
        </xp:customConverter>
    </xp:this.converter>
    <xp:viewColumnHeader
        value="Header"
        id="viewColumnHeader1">
    </xp:viewColumnHeader>
</xp:viewColumn>

We are imploding values by <br/> string and providing content type so it won't escape the html output.