3 Replies Latest reply: May 25, 2012 2:40 AM by Joonas Linkola-Oracle RSS

    Popup closing even with validation errors in IE - works correctly in FF

    Joonas Linkola-Oracle
      Hi,

      Using JDeveloper 11.1.1.4.

      We have a page where the user can upload files via a popup. After selecting the file to upload and submitting, the file type and size are validated against application parameters. If the validation fails, the inputFile component is set invalid and a ValidationException is thrown. In Firefox, the functionality is as expected: the popup stays open and the validation error message is displayed next to the inputFile component. In Internet Explorer, however, the popup closes without any error being displayed.

      Popup:
      <af:popup id="pt_fileUploadPopUp" contentDelivery="lazyUncached"
                              binding="#{FileUploadOperations.uploadFormPopup}">
      // ...
      <af:inputFile label="#{UC1315ResourceBundle['L1336']} "
                                        id="pt_i3f1"
                                        value="#{FileUploadOperations.uploadedFile}"
                                        requiredMessageDetail="#{UC1315ResourceBundle['REQ_MSG_FILE_UPLOAD']}"
                                        validator="#{FileUploadOperations.validateFile}"
                                        required="true"/>
      // ...
      <af:commandButton id="pt_CB_2001"
                                                  text="#{UC1315ResourceBundle['BUTTON_2007']}"
                                                  actionListener="#{FileUploadOperations.uploadFile}"
                                                  partialSubmit="true"
                                                  disabled="#{pageFlowScope.pApplicationMode == 'PREVIEW'}"/>
      // ...
      </af:popup>
      Validator method:
          public void validateFile(FacesContext facesContext,
                                   UIComponent uIComponent, Object object) {
                  try {
                      // validation logic
                  } catch (CustomFileUploadException exp) {
                      inputFileComponent.resetValue();
                      inputFileComponent.setValid(false);
      
                      FacesMessage facesErrorMessage = new FacesMessage();
                      facesErrorMessage.setSeverity(FacesMessage.SEVERITY_ERROR);
                      facesErrorMessage.setDetail(exp.getMessage());
                      facesErrorMessage.setSummary(exp.getMessage());
                      throw new ValidatorException(facesErrorMessage);
                  }
              }
          }
      Any ideas what might be the problem here?

      Thanks,

      Joonas