解決策が見つからないという問題に直面しています...次のようなselectManyChoiceコンポーネントがあります。
<af:selectManyChoice value="#{bindings.my_VO1.inputValue}"
label="myLabel" id="smc1"
binding="#{pageFlowScope.myBean.myMultiSelection}"
autoSubmit="true">
<f:selectedItems value="#{bindings.my_VO1.items}" id="si1"/>
</af:selectManyChoice>
値を取得するために、次のような 2 つのボタンを使用してテストしました。
<af:commandButton text="First Button"
id="cb1"
action="#{pageFlowScope.myBean.saveSelection}>
<af:fileDownloadActionListener method="#{pageFlowScope.myBean.exportReport}"/>
</af:commandButton>
と:
<af:commandButton text="Second Button"
id="cb2"
action="#{pageFlowScope.myBean.saveSelection}/>
2 番目のボタンは、選択された値を正常に取得し、画面に出力できます。ただし、最初のボタンはできませんでした。次のコード行で myMultiSelection.getValue() を呼び出そうとすると、常に NullPointerException がスローされます。
public String saveSelection() {
if (myMultiSelection.getValue() != null) {
それらの唯一の違いは、fileDownloadActionListener タグです。そのタグが最初のボタンの内部動作に影響を与えていたのだろうか...しかし、ボタンの目的は選択した値に基づいてpdfファイルを生成し、ブラウザにそのファイルをダウンロードさせることであるため、それでもそのタグが必要です. 誰かが私を正しい方向に向けることができますか?