2 Replies Latest reply on Apr 15, 2008 12:55 PM by Matt Schrader

    getting list of files from fileUpload component

    Alexey Kakunin Newbie

      Hello!

      In one of application I'm working on we need to implement something like sending emails with attachments. currently I'm changing logic for working with attachment from our custom implementation to fileUpload.

      So, I can do it quite easy: via fileUpload component with immediateUpload="true" will add files, uploadEvent will be handled by session-based bean (let say AttachmentsController).So, user will select some file - this file will be upload into this session-bean.

      Then user enter text of email and press send. Processor of email-sender will get text from form, list of attachment from attachments' bean used for fileUpload component - and do everything that it need.

      Now, I need to display the list of files, attached to email, prepeared to send. I can easily do it - since I have list of files in AttachmentsController.

      But it will dublicate functionality, already implemented by UploadComponent - it is already display list of files to upload, with cancel button for each individual file.

      But - I cannot use this list - I do not found any field contained list of files in HtmlFileUpload component.

      So - maybe somebody, more experience in this component may suggess something?

      Ideally it will be like this:
      fileUpload component handle list of files to upload - user add new files, removes them from list.

      Form has some extra fields (textArea for example) and "submit" button.

      Then we press submit - we access fileUpload component (for example via binding), get list of files from it - and process it together with other form-fields.

      Is it possible implement something like this?