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 InputFile uploading multiple files not sending all files

User735763-OracleAug 27 2018 — edited Aug 28 2018

Use case: A popup contains a inputFile control and the valueChangeListener is defined in session bean. It works file with single upload file. When multiple files are selected, RichInputFile breaks the upload files into two patches. The first patch contains first half of selected file plus one, and the second patch contains the rest. The problem only the first patch will trigger valueChangeListener while the popup is insight. Probably because the value of inputFile does not change, the second patch will trigger the handler. When the popup is dismiss, both patches will be uploaded. Unfortunately we need to see both patches in the popup for editing. Below is the definition of the inputFile definition.

Questions:

1) How to configure the inputFile upload all files in one patch?

2) If it is not possible to configure how upload file works, how to force the second patch to trigger the handler.  Try resetting the value or setting the value to null with no luck. Below are code fragment to force value change.

=====================================================================

// java code to force value change in event handler

            RichInputFile inputComponent =

                (RichInputFile)valueChangeEvent.getComponent();

            inputComponent.resetValue();

            ResetUtils.reset(inputComponent);

           UIComponentUtil.refreshComponents("file1");

           ((RichInputFile)valueChangeEvent.getComponent()).setValue(null);

=====================================================================

<af:panelFormLayout id="fform" styleClass="AFStretchWidth" labelAlignment="top">

      <af:inputFile label="#{pageFlowScope.myLabel}" id="file1"

         valueChangeListener="#{pageFlowScope.myBean.fileUploadValueChanged}"

               clientComponent="true"  autoSubmit="true" immediate="true"  maximumFiles="20"/>

       <af:panelStretchLayout id="IEFUPS2" styleClass="AFStretchWidth"  endWidth="150px"  startWidth="0px">

             <f:facet name="end">

                   <af:outputText value="#{pageFlowScope.myBean.maxFileSize}" id="ot1"/>

             </f:facet>

        </af:panelStretchLayout>

   </af:panelFormLayout>

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2018
Added on Aug 27 2018
3 comments
352 views