xpages 视图面板列多值分隔符 [英] xpages view panel column multivalue separator

查看:20
本文介绍了xpages 视图面板列多值分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

视图中有一个列具有多值分隔符作为新行.

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

但是当我将此视图拖放到我的 XPage 中(作为 )时,多个值显示在 , 中,而不是在不同的行中.

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?

提前致谢.

推荐答案

此处必须使用 customConverter.因为 convertList 只需要一个字符作为分隔符.

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>

我们通过 <br/> 字符串内爆值并提供内容类型,因此它不会转义 html 输出.

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

这篇关于xpages 视图面板列多值分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆