2 Replies Latest reply on Jan 9, 2012 9:50 AM by ashikenshin

    fileupload listener

    ashikenshin

      Hello, newbie question. I'm trying to figure out how to make the example work. I basically copied all the files from the example and for gui I placed it on a modal panel which is shown when a button is pressed.

       

      the problem I'm having is that even though the fileupload box says it uploaded the file, nothing is to be found. the box on the side doesn't update with anything. I tried debugging and the listener is never called. I tried some of the solutions posted around here, well basically just allowing flash and setting autoupload to false but I'm having the problem still.

       

      please help me

       

       

      here is the jsp code

       

       

      <%@ include file="/pages/common/taglibs.jsp"%>
      
      <rich:modalPanel id="FileUploadBox" autosized="true" style="overflow:auto;" rendered="#{fileUploadBean != null}"
        domElementAttachment="form">
        
           <a4j:form id="FileUpload">
             <%@ include file="/pages/common/statusQueue.jsp"%>
                     <DIV id="screen" class="width4">
                       <h:panelGroup styleClass="tituloPagina">
                       <h:outputText value="File Upload" styleClass="tituloPagina" />
                       <rich:spacer styleClass="separadorTitulo" />
      
                       </h:panelGroup>
                          <br />
      
                       <h:form enctype="multipart/form-data">
                       <h:panelGrid columns="2" columnClasses="top,top">
                            <rich:fileUpload
                                    fileUploadListener="#{fileUploadBean.listenerUpload}"
                                    maxFilesQuantity="#{fileUploadBean.uploadsAvailable}" id="upload"
                                    immediateUpload="false" acceptedTypes="jpg, gif, png, bmp"
                                    allowFlash="#{fileUploadBean.useFlash}">
                                    <a4j:support event="onuploadcomplete" reRender="info" />
                            </rich:fileUpload>
                            <h:panelGroup id="info">
                            <rich:panel bodyClass="info">
                                 <f:facet name="header">
                                      <h:outputText value="Uploaded Files Info" />
                                 </f:facet>
                                 <h:outputText value="No files currently uploaded"
                                          rendered="#{fileUploadBean.size==0}" />
                                         <rich:dataGrid columns="1" value="#{fileUploadBean.files}"
                                                    var="file" rowKeyVar="row">
                                                   <rich:panel bodyClass="rich-laguna-panel-no-header">
                                                   <h:panelGrid columns="2">
                                                             <a4j:mediaOutput element="img" mimeType="#{file.mime}"
                                                                        createContent="#{fileUploadBean.paint}" value="#{row}"
                                                                    style="width:100px; height:100px;" cacheable="false">
                                                                       <f:param value="#{fileUploadBean.timeStamp}" name="time" />
                                                              </a4j:mediaOutput>
                                                             <h:panelGrid columns="2">
                                                                       <h:outputText value="File Name:" />
                                                                          <h:outputText value="#{file.name}" />
                                                                      <h:outputText value="File Length(bytes):" />
                                                                       <h:outputText value="#{file.length}" />
                                                              </h:panelGrid>
                                                     </h:panelGrid>
                                                     </rich:panel>
                                         </rich:dataGrid>
                                 </rich:panel>
                                 <rich:spacer height="3" />
                                 <br />
                                 <a4j:commandButton action="#{fileUploadBean.clearUploadData}"
                                           reRender="info, upload" value="Clear Uploaded Data"
                                           rendered="#{fileUploadBean.size>0}" />
                       </h:panelGroup>
                  </h:panelGrid>
                 </h:form>
        </ui:composition>
        </DIV>
        </a4j:form>
      </rich:modalPanel>
      

       

       

      which is basically the example, also attached are the web.xml and the faces config.xml files, maybe the problem is there? fileUploadBean and file are the same from the example.