xpages view panel column multivalue separator

2020-04-12 09:30发布

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.

标签: xpages
1条回答
姐就是有狂的资本
2楼-- · 2020-04-12 10:14

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.

查看更多
登录 后发表回答