4 Replies Latest reply on May 23, 2011 11:57 AM by Mark Hammond

    rich:fileUpload uploadcomplete event fired only once

    Mark Hammond Newbie

      Have the following fileUpload element:

       

      <rich:fileUpload id="uploadls" acceptedTypes="jpg,bmp,gif,png" fileUploadListener="#{surveyForm.bannerlsListener}" styleClass="fu">

      <a4j:ajax event="uploadcomplete" render="@form" />

      </rich:fileUpload>

       

      When a file is uploaded, the bannerlsListener is correctly called, the ajax event triggers, and the form is re-rendered (One of the things re-rendering does is populate an image preview box)

       

      When the form re-renders, the fileUpload box resets to it's default state (Add button only, no clear/clear all) [This may be normal behaviour]

       

      If you try and upload a file at this point, the listener fires correctly, but the ajax event does NOT trigger, so the form is not re-rendered (thus the image preview box does not update)

       

      If you manually re-render the page, the image preview updates, showing that the file upload did correctly complete, but the Ajax call didn't occur.

       

      Any ideas if this is a bug, or just me? If it's me, can anyone suggest a work-around?