3 Replies Latest reply on Jan 19, 2009 6:23 AM by akakunin

    Different reuqest-scopes used in fileUpload listener and rer

    akakunin

      Hi!

      First of all - want say BIG THANK YOU to RichFaces team for great job they are doing!

      Now about my problem:
      We are using fileUpload for files uploading, after uploading the file we need to rerender part of page.

      Backing bean, responsible for rerendering this part is request-scoped (we are using JSF & Spring integration) - and rerendering depends from some request-parameters
      So, to correctly rerender this part of page - we need place correct argument into our page, or, correctly initialize this request-scoped backing bean.

      Actually - we managed to make it working with RichFaces 3.2.0: to pass correct attribute into request we added:

      <rich:fileUpload fileUploadListener="#{attachmentUploadController.upload}"
      immediateUpload="false"
      autoclear="true">
      <f:param name="page" value="#{page}"/>
      <a4j:support event="onuploadcomplete" reRender="pageContent/>
      </rich:fileUpload>

      into same form.
      So, during request, performed file upload, #{page} was passed into request arguments. After processing upload, control rerendered part of page (pageContent) - and this rerendering was done in same request as file-uploading send. As result, request-scoped backing bean, received page argument specified in input-hidden, and correctly rendered it's content.

      As I said - it is worked with RichFaces 3.2.0 (including SR1), but stopped to work in RichFaces 3.2.0 (and still not working in RichFaces 3.3.0). We were able to stay with RichFaces 3.2.0, but 3.3.0 has some other important features, so, it will be really great, finally, upgrade to new version, but this problem become a road-block for us.

      So - it looks like - rerendering is performed in another request, or, request-scope cleared somehow after performing file upload.

      Also I tried to get request-scoped backing-bean in attachmentUploadController.upload and initialize it with correct page-name, but, it also did not worked - during rendering phase new backing-bean was created and this information was lost.

      Unfortunately we are not using neiver seam nor SpringFlow to enable conversation-scope (what looks like a good solution for us), so, need to find a way to pass some data from uploadControl into request, used for rerendering

      Does anybody has any suggestions why it may stop work in 3.2.0, or how else it possible to solve this problem? Any suggestion will be very helpful!