3 Replies Latest reply on Jun 27, 2008 3:32 PM by guarf

    Errors with FileUpload

    guarf

      I found some errors using FileUpload:

      Apache log:

      WARNING: Component formBody:j_id527 just got an automatic id, because there was no id assigned yet. If this component was created dynamically (i.e. not by a JSP tag) you should assign it an explicit static id or assign it the id you get from the createUniqueId from the current UIViewRoot component right after creation! Path to Component: {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /main.xhtml][Class: org.ajax4jsf.component.html.HtmlAjaxRegion,Id: bodyStatus][Class: org.ajax4jsf.component.html.AjaxForm,Id: formBody][Class: javax.faces.component.html.HtmlPanelGrid,Id: uploadPanelGrid][Class: org.richfaces.component.html.HtmlFileUpload,Id: upload][Class: org.richfaces.component.html.HtmlProgressBar,Id: j_id527]}
      


      i dont know how to define the ID for the progressBar.

      xhtml page:
      <ui:composition>
      
       <f:loadBundle basename="com.planex.smsbroadcaster.messageresource.MessageResource" var="msg" />
       <div class="menu_separator" />
       <rich:spacer style="height:10px;" />
      
       <h:panelGrid id="uploadPanelGrid" columns="2" columnClasses="top, top" >
       <rich:fileUpload
       fileUploadListener="#{fileUploadBean.listener}"
       maxFilesQuantity="#{fileUploadBean.uploadsAvailable}"
       immediateUpload="#{fileUploadBean.autoUpload}"
       acceptedTypes="jpg, gif, png, bmp, txt"
      
       id="upload"
       listHeight="58px"
       listWidth="435px"
      
       <f:facet name="label">
       <h:outputText value="{_KB}KB from {KB}KB uploaded - {mm}:{ss}" />
       </f:facet>
       <a4j:support id="fileUploadSupport" event="onuploadcomplete" reRender="info" />
       </rich:fileUpload>
       <h:panelGroup id="info">
       <rich:panel bodyClass="info">
      
       <h:outputText value="No file currently uploaded"
       rendered="#{fileUploadBean.size==0}" styleClass="outputText"/>
       <rich:dataGrid columns="1" value="#{fileUploadBean.files}"
       var="file" rowKeyVar="row">
      
       <h:panelGrid columns="2">
       <h:outputText value="File Name:" styleClass="outputText"/>
       <h:outputText value="#{file.name}" styleClass="outputText"/>
       <h:outputText value="File Length(bytes):" styleClass="outputText"/>
       <h:outputText value="#{file.length}" styleClass="outputText"/>
       </h:panelGrid>
      
       </rich:dataGrid>
       </rich:panel>
       <rich:spacer height="3"/>
       <br />
       <a4j:commandButton action="#{fileUploadBean.clearUploadData}"
       reRender="info, upload,process" value="Clear Uploaded Data"
       rendered="#{fileUploadBean.size>0}" />
      
       </h:panelGroup>
       </h:panelGrid>
      
      </ui:composition>


      The other error is with IE, when I add the file (upload) it work OK, but the IE status still waiting for something :), i dont know what is.

      Thx in advance.

        • 1. Re: Errors with FileUpload
          guarf

          any idea ?

          • 2. Re: Errors with FileUpload

            About message in your log:

            you see that this is not error. It just warning. It's normal. FileUpload creates ProgressBar dynamically and does not assign id. So it's cause of warning message.

            About IE status:

            Do you mean browser's status at the bottom of window?
            What RF version do you use?
            I cannot see this behavior on the 3.2.1.
            Anyway 'waiting' status is not actual I think. It's cause of some mistakes in javascript. As I see they were fixed.


            • 3. Re: Errors with FileUpload
              guarf

              i'm using RF 3.2.2 and facelets 1.1.14 with tomcat 6.0.16.

              the browser status what I'm talking is in the page tab (IE 7), and i have found another "bug"... when i try to upload the first file, i have to click twice in the Add button to make it work.

              Thx.