以下は、sessionScope 変数にバインドされた radiobuttongroup を含む単純な Xpage です。ラジオ ボタン グループの onclick イベントは、計算フィールドを設定します。セッション スコープ変数を初期化するための afterPageLoad イベントがあります。
すべてうまくいきます。ただし、セッション スコープ変数を (デバッグ カスタム コントロールを使用して) クリアすると、onclick イベントは発生しません。ユーザーは必要に応じてラジオ ボタンをクリックできます。F5 を押してページをリロードするまで、計算フィールドは変更されません。以下は私のページのソースです。onclick イベントを発生させる方法に関する提案はありますか? ユーザーがセッション変数をタイムアウトさせてから、ラジオ ボタンをクリックし始めると、これは大きなユーザビリティの問題になります。
ハワード
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.afterPageLoad><![CDATA[#{javascript:print("starting the afterPageLoad event");
if (sessionScope.init != true|| sessionScope.radioData == null){
//setup default values'
print("initing the value");
sessionScope.init = true;
sessionScope.radioData = "Red";
}
}]]></xp:this.afterPageLoad>
<xp:radioGroup id="radioButtons" value="#{sessionScope.radioData}">
<xp:selectItem itemLabel="Red"></xp:selectItem>
<xp:selectItem itemLabel="Green"></xp:selectItem>
<xp:selectItem itemLabel="Blue"></xp:selectItem>
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="computedField1">
<xp:this.action><![CDATA[#{javascript:print("starting onclick event");
if (sessionScope.init != true){
print("reload the page");
context.reloadPage();
}
var radioval = getComponent("radioButtons").getValue();
getComponent("computedField1").setValue(radioval); }]]></xp:this.action>
</xp:eventHandler></xp:radioGroup>
<xp:text escape="true" id="computedField1"></xp:text></xp:view>