1 Reply Latest reply on Oct 6, 2012 1:37 PM by Carlos Herrera

    Visual and functional Issues with <rich:fileUpload>

    Carlos Herrera Newbie

      Hello community...


      Im trying to implement file upload functionality in my application. Im using RichFaces 4.x.


      This is the code in my xhtml page:


      <?xml version='1.0' encoding='UTF-8' ?>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml"







              <title><h:outputText value="#{tags['spirit.appname']}"/></title>

              <link href="./styles/styles.css" rel="stylesheet" type="text/css"/>



              <ui:composition template="./templates/main.xhtml">

                  <ui:define name="content">

                      <rich:panel styleClass="body">

                          <f:facet name="header"><h:outputText value="#{tags['upload.title']}"/></f:facet>

                          <h:outputText value="#{tags['upload.title']}" styleClass="bodyTitle"/>

                          <p><h:outputText value="#{tags['upload.instructions']}" styleClass="bodyInstructions"/></p>




                                      <h:panelGrid columns="2">

                                          <h:outputText value="#{tags['upload.filename']}" styleClass="formLegends"/>

                                          <h:inputText id="txtFileName" value="#{uploadBean.fileName}" required="true"/>

                                          <h:outputText value="#{tags['upload.filetype']}" styleClass="formLegends"/>

                                          <h:selectOneMenu id="cboTpMaterial" value="#{uploadBean.idTpMaterial}" >

                                              <f:selectItems value="#{uploadBean.listaTpMateriales}" var="tpMaterial"

                                                             itemLabel="#{tpMaterial.nombre}" itemValue="#{tpMaterial.idTpMaterial}"/>


                                          <h:outputText value="#{tags['upload.desc']}" styleClass="formLegends"/>

                                          <h:inputTextarea id="txtDesc" value="#{uploadBean.desc}"/>




                                      <h:panelGrid columns="2">

                                          <rich:fileUpload id="txtUpload" fileUploadListener="#{uploadBean.uploadListener}"/>











      The issues are:


      • The component appears without theme or visual aspect in the page (running).
      • The visualization panel are located down in the page respect the upload component (in the showcase appears next rigth to the upload component).
      • With any file i was upload, the visualization panel shows the legend "This XML file does not appear to have any style information associated with it. The document tree is shown below."
      • I need to put a simple (without visualization panel) file upload component without ajax support that upload the file in the submit event with the other fields in the form. I need to disable the visualization functionality but i dont see any tag to disable this feature.


      Can you help me to solve this issues.


      I really appreciate your help.



        • 1. Re: Visual and functional Issues with <rich:fileUpload>
          Carlos Herrera Newbie

          Hello community...


          Testing the code many times, reviewing the URL in the address bar of any web browsers, im notice that URL never change. This is happening because im implementing implicit navigation. I dont use faces-config declarative navigation or method-based navigation.


          After that, i put the complement "?faces-redirect=true" next to the outcome String declarated in "action" property of commandLink tag. This enable the full functionality and visual features of <rich:fileUpload> component.


          I hope this will be useful.