checkBoxGroup:typeof return [Ljava.lang.String

问题描述 投票:0回答:1

我有以下XPage,一个checkboxgroup和一个computedfield

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
    <xp:panel id="ref">
        <xp:checkBoxGroup id="checkBoxGroup1">
            <xp:selectItems>
                <xp:this.value><![CDATA[#{javascript:var val = ["Test1", "Test2"];
return val}]]></xp:this.value>
            </xp:selectItems>
            <xp:eventHandler event="onchange" submit="true"
                refreshMode="partial" refreshId="ref">
            </xp:eventHandler>
        </xp:checkBoxGroup>

        <xp:text escape="true" id="computedField3">
            <xp:this.value><![CDATA[#{javascript:typeof getComponent("checkBoxGroup1").getValue()}]]></xp:this.value>
        </xp:text>
        <xp:br></xp:br>
    </xp:panel>
</xp:view>

当我单击复选框时,我期望计算字段返回一种类型的数组,而是返回[Ljava.lang.String

如何更改我的代码,以便如果我选择一个或多个复选框,computedField将返回“数组”或“向量”的类型

javascript xpages typeof
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.