14 Replies Latest reply on Aug 14, 2008 11:40 AM by Andrei Markavtsov

    rich:fileUpload as part of form is not working

    Khaled Al-Shehri Newbie

      Hi all,

      I want to use rich:fileUpload component as part a form, to be submitted one time .. for example in my case:
      I have a form to create a new client account .. so the user will fill the client id, name, and logo image THEN the user submit the form one time.
      In create method (the action) i will take all the inputs and insert them directly to DB.

      The problem:
      rich:fileUpload component is using AJAX in uploading, so the listener only can see the uploaded file, but when the user submit the form, the file is gone.

      I'm using rich:fileUpload as a part of h:form as follow


      <f:view><h:form>
      
      <h:inputText value="#{createNewClient.client.id}" id="idInput" />
      
      <h:inputText value="#{createNewClient.client.name}" id="nameInput" />
      
      <rich:fileUpload uploadData="#{createNewClient.uploadData}" id="logoImageInput" ajaxSingle="true"
       rendered="#{not createNewClient.created}" maxFilesQuantity="1"
       acceptedTypes="jpg, gif, png, bmp" immediate="true" listHeight="70px"
       fileUploadListener="#{createNewClient.uploadListener}" immediateUpload="true">
      
      </rich:fileUpload>
      
      <h:commandButton value="#{msg.create}" action="#{createNewClient.create}" />
      
      </h:form>
      </f:view>



      please help me,

      can I use rich:fileUpload as a part of form?? HOW??

      thanks