0 Replies Latest reply on Jun 4, 2010 5:13 AM by pedalshoe

    fileUpload and page flow

    pedalshoe

      Hi,
      I'm using s:fileUpload on a page to upload images.  The navigation is controlled by a page flow in a jpdl file. 
      first pass: the user uses the fileUpload to successfully upload an image.  I also use a s:graphicImage tag to display the image.   the user clicks the continue button to view the next screen in the page flow.


      second pass: if the user wants to edit the upload they can go back to the upload screen...  when they get to the screen, the previously uploaded image is shown..  but when clicking the button again without any uploads, the previously uploaded image is overwritten by null.  It seems the pageflow triggers a file upload of nothing which resets the field that contains the image




      code from docUpload.xhtml:



      <h:form id="upload_form" enctype="multipart/form-data"  >
      :
      :
      <s:decorate id="UploadField" template="layout/edit.xhtml">
         <ui:define name="label">image:</ui:define>
           <s:fileUpload id="image" accept="image/png,image/gif,image/jpeg"
                         data="#{user.image}" contentType="#{user.imageContentType}"/>
             <s:graphicImage rendered="#{user.image ne null}"
                             value="#{user.image}">
               <s:transformImageSize width="100" maintainRatio="true"/>
             </s:graphicImage>
       </s:decorate>
      :
      :
      <h:commandButton tabindex="100" id="nextButton" styleClass="button" action="next" value="Continue" />
      </h:form>





      it seems like clicking the Continue button triggers the actual file upload to be invoked.  on second pass, though, i have no path information in the s:fileUpload field.  So it's trying to upload from a blank path...  should i place the path to the file back in the field to get around my problem or is there something I didn't do to prevent this from happening?


      Thank you,
      Christopher