function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
guru87guru87 

Issue with showing a loading message during file upload...

Dear Salesforce experts:

I have been trying to add a loading message screen on my visualforce pages during file upload using jQuery BlockUI.

I've got as far as showing a loading animation during the file upload process, but soon after the animation is shown, I get the following error message:

 

"apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute."

 

It appears I cannot use apex:InputFile in conjunction with the oncomplete attribute in my code. 

Does anyone know of a workaround to make the loading screen appear during file upload?

 

Here is my code below:

 

<apex:page standardController="Account" extensions="CustomController" standardStylesheets="false">

    <head>
      <apex:includeScript value="{!$Resource.jquery}"/>
      <apex:includeScript value="{!$Resource.jqueryblockUI}"/>
     
      <script type="text/javascript">
     
         j$ = jQuery.noConflict();
        
           function blockme() {
               j$.blockUI({message: '<img src="{!URLFOR($Resource.ajax_loader)}">'});   
             }  
                      
      </script>  
     </head>
     
     <apex:form enctype="multipart/form-data">
     <!-- ... extra code -->

      <apex:commandButton action="{!Save}" value="Save" onclick="blockme()" oncomplete="j$.unblockUI();"/>

     <!-- ... extra code -->

     </apex:form>
</apex:page>

 Any advice would be much appreciated!! =)