无法获得组合框的选定值

时间:2013-04-07 02:05:17

标签: xpages xpages-ssjs

我发疯了:我无法在onchange事件中访问组合框的选定值:

<xp:comboBox id="comboBox1" value="#{sessionScope.groupBy}">
<xp:selectItem itemLabel="nothing" itemValue=""></xp:selectItem>
<xp:selectItem itemLabel="State" itemValue="state"></xp:selectItem>
<xp:selectItem itemLabel="CCType" itemValue="cctype"></xp:selectItem>

<xp:eventHandler event="onchange" submit="true" refreshMode="complete">
            <xp:this.action>
                <xp:executeScript>
                    <xp:this.script>
<![CDATA[
#{javascript:sessionScope.groupBy = getComponent("comboBox1").getValue();
print( getComponent("comboBox1").getValue() )}
]]>
</xp:this.script>
                </xp:executeScript>
            </xp:this.action>
</xp:eventHandler>
</xp:comboBox>

我想存储值并重新加载页面以访问我刚刚提交的值。我也尝试过getSubmittedValue()和值。它们总是返回null。

这里的诀窍是什么?

2 个答案:

答案 0 :(得分:0)

我有类似的问题,但如果我理解你的困惑,我可能会有一个解决方案。您是否尝试捕获您选择的组合框字段的值是否正确?这是组合框的代码(名称:POVendor)。我正在绘制列表的视图名为“PLBV”。

@DbColumn(@DbName(),“PLBV”,1)

以下是Computed字段的代码,用于捕获组合框中选择的值。只需对组合框中的计算字段进行部分刷新即可。它应该工作正常。

var item = document1.getValue(“POVendor”);

退货;

答案 1 :(得分:0)

我遇到了类似的问题,尝试了以下选项,它对我有用。

将组合框的 onChange 事件上的服务器选项设置为完全更新,并选中“未经验证处理数据”选项

这将为您提供所需的结果。(您的sessionScope.groupBy将被设置为组合框的新选定值。

相关问题