0

私はいくつかのパスワード フィールドとドロップダウン ボックスを持っています。ドロップダウン値が変更されるたびに (値変更イベント)、利用規約に同意するポップアップを表示しています。利用規約に同意するとすぐに、パスワード フィールドはクリアされます。

XHTML ファイル

Enter Password: <h:inputSecret value="#{myBean.password}" />
Confirm Password: <h:inputSecret value="#{myBean.confirmPassword}" />
Select an Amount: <h:selectOneMenu value="#{myBean.amount}">
  <f:selectItems value="#{myBean.amountValues}" />
  <f:ajax event="valueChange" render="@this">
    <rich:componentControl target="pnl" operation="show" />
  </f:ajax>
</h:selectOneMenu>
<rich:popupPanel id="pnl" domElementAttachment="form" height="150" width="400" moveable="false" resizeable="false">
  <f:facet name="header"><h:outputText value="Do you accept our Terms&Conditions"/></f:facet>
  <h:commandButton value="Yes" immediate="true" action="#{myBean.agreed}"/>
  <h:commandButton value="No" immediate="true" action="#{myBean.disagreed}" />
</rich:popupPanle>

マイビーン

public void agreed() {
  //set some variables
}
public void disagreed() {
  //set some variables
}

何らかの理由でページ全体がレンダリングされます。フォームがまだ送信されていないため、パスワード値が Bean に設定されていません。どうすれば防ぐことができますか?

4

0 に答える 0