Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ADF popup cancel listener not invoked on closing dialog with validation errors

Vivek Sridhar-OracleJan 10 2018 — edited Jan 11 2018

The issue is when I enter some negative value in the inputBox and the validator method throws an error something like "Negative numbers not allowed". The dialog now has an error input box marked with red border and I decide to click outside the dialog to close it and reset the input box, but the inputBox is not reset. If I press Esc key or Ok button then only the popupCanceledListener is called and the inputBox is reset.

JSF code:

<af:popup contentDelivery="lazyUncached" autoCancel="enabled" popupCanceledListener="#{pageFlowScope.testBean.handleResetPopup}" childCreation="deferred" id="testPopup">
  <af:dialog type="none" modal="false" id="Dlg1">
  <af:inputText label="DECIMAL PLACES" columns="2" validator="#{pageFlowScope.testBean.validateDecimalPlaceValue}" value="#{pageFlowScope.testBean.decimalPlace}" id="input1" autoSubmit="true"></af:inputText>
  <f:facet name="acceptNFChange">
        <af:commandButton text="OK" id="cb1" actionListener="#{pageFlowScope.testBean.handleOkFromPopup}" partialSubmit="true"></af:commandButton>
  </f:facet>
  </af:dialog>
</af:popup>

Bean code:

public void handleResetPopup(PopupCanceledEvent popupCanceledEvent) {
  try {
        UIComponent component = popupCanceledEvent.getComponent();
        RichInputText inputText = (RichInputText)JSFUtil.findComponent(component, "input1");
        inputText.resetValue();
  } catch (Throwable th) {
        this.handleException(th);
 
}
}

Note: validator method validateDecimalPlaceValue()will check if negative value is entered or not in the inputBox and throw validation error if required.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2018
Added on Jan 10 2018
6 comments
2,694 views