0

私は夢中になっています: 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 を返します。

ここでのトリックは何ですか?

4

2 に答える 2

0

私は同様の問題に直面していましたが、以下のオプションを試してみましたが、うまくいきました。

コンボボックスのonChangeイベントのサーバー オプションを[完全更新] に設定し、[検証なしでデータを処理する] オプションをオンにします。

これにより、目的の結果が得られます (sessionScope.groupBy は、コンボボックスの新しく選択された値に設定されます。

于 2013-10-24T17:07:29.847 に答える