2 Replies Latest reply on May 13, 2009 12:29 PM by Kostya Piterskiy

    fileUpload, uploadData and keepalive

    Kostya Piterskiy Newbie

      hi!

      <f:view>
       <a4j:keepAlive beanName="bean.files"/>
       <h:form>
       <h:panelGrid columns="1">
       <h:panelGroup>
       <rich:fileUpload uploadData="#{bean.files}"
       fileUploadListener="#{bean.imagesListener}"
       maxFilesQuantity="#{bean.uploadsAvailable}"
       id="upload"
       immediateUpload="#{bean.autoUpload}"
       acceptedTypes="jpg, gif, png, bmp"
       allowFlash="#{bean.useFlash}">
       </rich:fileUpload>
       </h:panelGroup>
       <h:panelGroup>
       <a4j:commandLink action="#{bean.saveImages}" value="Save"/>
       </h:panelGroup>
       </h:panelGrid>
       </h:form>
      </f:view>
      

      and bean is

      public class MyBean
      {
       private ArrayList<UploadItem> files = new ArrayList<UploadItem>();
       //getters and setters and another declaration
      public void saveImages()
       {
       for(UploadItem item:files)
       {
       //save images
       }
      
      }
      

      When file upload complete array contents all uploaded items, but when i press on commandLink and debug in saveImages files array size = 0.
      I don't understand what wrong. I'm using <a4j:keepalive> but it's not work.
      Sorry for my english. Thanks!!