2 Replies Latest reply on Oct 29, 2008 6:36 AM by andrei_exadel

    Uploading Files within a Form

      Is it possible to create a form that has a combination of an input field (say a note) plus a set of file attachments? I would like both the note and the files to be uploaded when the user hits submit. I don't want the user to have to press upload and then save...
      Thanks

        • 1. Re: Uploading Files within a Form
          anders.norgaard

          Good question. I couldn't find a way, so I just used the SEAM fileupload instead. <s:fileUpload>

          Best,
          Anders

          • 2. Re: Uploading Files within a Form

            Try the following code:


            <h:form>
            <rich:fileUpload id="fileUploadId"..>
            ...
            <h:commandButton action="..." value="...">
            <rich:componentControl event="onmousedown"
            for="uploadId" operation="beforeSubmit">
            
            </h:commandButton>
            </h:form>


            In this case all inputs will be submitted by one request. Update model for all component should be executed, fileUploadListener should be invoked.