1 2 3 Previous Next 35 Replies Latest reply on Feb 28, 2008 12:14 PM by ronanker Go to original post
      • 15. Re: Toward rich:fileUpload . Why? and What?
        juanignaciosl

        In addition to previously spoken (iframe ajaxified, progress bar, type and size filtering...) I'd also like the component to show file name once it's uploaded (in a similar fashion than a 'inline editor') and an optional 'remove' button next. It'd be also nice to support 'displayValueOnly' Tomahawk attribute (which would be just its name with the download link).

        I'd also like to say that this is neccesary. After looking for something similar, I finally did one component with facelets and Dojo. Yes, there're many similar things, but not a Ajax, JSF, RichFaces compatible one...

        • 16. Re: Toward rich:fileUpload . Why? and What?

          Sorry for my english.

          The possibility to cancel a current update. (a cancel button to the file upload)

          • 17. Re: Toward rich:fileUpload . Why? and What?
            pourmo

            Hi
            We have based our project purley on JBoss seam and richfaces and we are currently using seam fileupload, However our uses are asking us for multiple file uploads, we are talking about 1000s of documents, so perhaps something that allows our uses to choose a directory as well as multiple files in one go and not having to popup the file chooser dialog 1000 times.

            Cheers
            Mo

            • 18. Re: Toward rich:fileUpload . Why? and What?
              amitev

               

              "pourmo" wrote:
              Hi
              We have based our project purley on JBoss seam and richfaces and we are currently using seam fileupload, However our uses are asking us for multiple file uploads, we are talking about 1000s of documents, so perhaps something that allows our uses to choose a directory as well as multiple files in one go and not having to popup the file chooser dialog 1000 times.

              Cheers
              Mo


              Why don't you just tell your users to zip the contents and you'll process it on the server side

              • 19. Re: Toward rich:fileUpload . Why? and What?

                just my 2 cents , an ajax fileupload would be cool, otherwise i dont need another file uplaod component

                • 20. Re: Toward rich:fileUpload . Why? and What?
                  fzaker

                  I am agree with Holger. It would be nice if rich faces could implement an ajax uploader. In addition, providing a progress bar for upload is nice (as others mentioned.)

                  • 21. Re: Toward rich:fileUpload . Why? and What?
                    ybxiang.wolf

                    Rich:upload is really wanted!!!
                    Who can endure to use so many components(such as so called tomhawk)?
                    Who can ensure that those components really work with richfaces?
                    who can ensure that those compoments will be maintained as richfaces does???


                    Just do it! We need it!!!
                    I will be glad to see richfaces have anything i want, then i do not need to lear and use so many other compoments.

                    The most important is richfaces can be updated and maintained!

                    • 22. Re: Toward rich:fileUpload . Why? and What?
                      ybxiang.wolf

                      tomhawk? jodo?
                      Why should i mess my web.xml???
                      Why not just seam and richfaces and ajx4jsf???
                      I hate messed web.xml, it's prone to error!!!

                      • 23. Re: Toward rich:fileUpload . Why? and What?
                        carloszaniolo

                        http://jboss.com/index.html?module=bb&op=viewtopic&p=4026758#4026758

                        It would be good an AJAX FILEUPLOAD component so I would not need to writting nasty javascript code managing the control in a frame.

                        GMail approach is the best!


                        • 24. Re: Toward rich:fileUpload . Why? and What?
                          carloszaniolo

                          http://jboss.com/index.html?module=bb&op=viewtopic&p=4026758#4026758

                          It would be good an AJAX FILEUPLOAD component so I would not need to writting nasty javascript code managing the control in a frame.

                          GMail approach is the best!


                          • 25. Re: Toward rich:fileUpload . Why? and What?
                            akakunin

                            1. For me I meet problems to use together tomahawk and richfaces. I will prefer to use one component library (richfaces for now) instead of compilation of my application from bundle of libraries. It will makes it much more easy to configure, develop and support my application.

                            We do not need to reinvent the weel - most fileUpload components are open-source - so, I do not see the problem to migrate their code into RichFaces.

                            2. progress bar, uploading several files at once. We already implemented it in emforge with using tomahawk (http://www.emforge.org/wiki/AjaxBasedFileUploadForJava) - but it will be nice to have such component out-of-the-box.

                            3. Ah, yes, skinnig for "choose file" button

                            • 26. Re: Toward rich:fileUpload . Why? and What?

                              Hi,

                              My Main reason is I am not able to use t:inputFileUpload with a4j:commandButton.

                              I am submitting the form using a4j:commandButton But the UploadFile is coming as null in the bean.

                              You can suggest me an alternative meanwhile I can use.

                              Thanks
                              Venkat.

                              • 27. Re: Toward rich:fileUpload . Why? and What?

                                 

                                "venkatsep14" wrote:
                                Hi,

                                My Main reason is I am not able to use t:inputFileUpload with a4j:commandButton.

                                I am submitting the form using a4j:commandButton But the UploadFile is coming as null in the bean.

                                You can suggest me an alternative meanwhile I can use.

                                Thanks
                                Venkat.


                                This behaviour is prohibited on the browser level due to the security reason. You will not not be able to do so with rich:fileUpload as well.

                                • 28. Re: Toward rich:fileUpload . Why? and What?

                                  That means I can't use the file upload with Ajax Submit.

                                  Thanks
                                  venkat.

                                  • 29. Re: Toward rich:fileUpload . Why? and What?
                                    juanignaciosl

                                    I use a facelet component which uses Dojo (loaded with Tomahawk's 'dojoInitializer'). It simulates GMail behaviour: user sees a common file input field, it's sent onchange, and then it displays a download link and a delete one.

                                    This code is quite complicated but AFAIK it works, hope it's useful for somebody until RichFaces releases their version. It mixes a4j, dojo, tomahawk, javascript... This is far from perfect, I know

                                    <ui:composition>
                                    
                                     <a4j:outputPanel>
                                    
                                     <c:if test="#{empty disabled}">
                                     <c:set var="disabled" value="${false}" />
                                     </c:if>
                                     <c:if test="#{empty displayValueOnly}">
                                     <c:set var="displayValueOnly" value="${false}" />
                                     </c:if>
                                    
                                     <a4j:loadBundle basename="messages"
                                     var="mesgFichero" />
                                    
                                    
                                     <h:outputText rendered="${value == null}" styleClass="mensajeError"
                                     value="#{mesgFichero.FICHERO_NULL}" />
                                     <a4j:outputPanel id="${id}" rendered="${value != null}">
                                    
                                     <c:if test="${! displayValueOnly}">
                                     <t:inputFileUpload id="${id}_infiup" accept="*" styleClass="text"
                                     value="${value.fichero}" storage="file" maxlength="1000000"
                                     rendered="${value.fichero == null and value.ficheroGuardado == null}"
                                     disabled="${disabled}"
                                     onchange="${id}IFUEspera=this.nextSibling;${id}IFUEsperaEnlace=this.nextSibling.nextSibling;this.style.display='none';this.nextSibling.style.display='inline';enviar${id}();">
                                     <ui:insert />
                                     </t:inputFileUpload>
                                     <t:outputText value="#{mesgFichero.ESPERA_FICHERO}"
                                     id="${id}_IFU_Espera" forceId="true" style="display: none;" />
                                     <t:panelGroup id="${id}_enlace" style="display:none;" forceId="true">
                                     <t:commandLink value="#{mesgFichero.FICHERO_ENVIADO}"
                                     forceId="true" styleClass="botonImagen botonGuardar"
                                     action="#{value.descargarFichero}" />
                                     <a4j:commandLink value="#{mesgFichero.FICHERO_BORRAR}"
                                     styleClass="botonImagen botonEliminar" rendered="${! displayValueOnly}"
                                     action="#{value.eliminarFichero}" reRender="${id}"
                                     ajaxSingle="true" limitToList="true" />
                                     </t:panelGroup>
                                     </c:if>
                                    
                                     <t:commandLink value="#{value.ficheroGuardado.titulo}"
                                     styleClass="botonImagen botonGuardar"
                                     rendered="${(value.fichero != null || value.ficheroGuardado != null)}"
                                     action="#{value.descargarFichero}" />
                                     <a4j:commandLink title="#{mesgFichero.FICHERO_BORRAR}" value=" "
                                     styleClass="botonImagen botonEliminar"
                                     rendered="${(value.fichero != null || value.ficheroGuardado != null) and (! displayValueOnly)}"
                                     action="#{value.eliminarFichero}" reRender="${id}"
                                     ajaxSingle="true" limitToList="true" />
                                    
                                     <a4j:outputPanel ajaxRendered="true">
                                     <f:verbatim>
                                    
                                     <script type="text/javascript">
                                     var ${id}IFUEspera;
                                     var ${id}IFUEsperaEnlace;
                                     //<![CDATA[
                                     function obtenerInputFile(nombre) {
                                     var inputFile = null;
                                     var inputs = document.getElementsByTagName("input");
                                    
                                     dojo.debug("Tamanho:", inputs.length);
                                     dojo.debug('Buscando inputFile', nombre);
                                     for(var i = 0; i < inputs.length && inputFile == null; i++) {
                                     if(inputs.type == "file" && inputs.id != null && inputs.id.indexOf(nombre) != -1) {
                                     inputFile = inputs;
                                     }
                                     }
                                     return inputFile;
                                     }
                                     function enviar${id}() {
                                     var formulario = obtenerInputFile('${id}_infiup').form;
                                     dojo.debug('Se va a enviar el formulario ', formulario.id);
                                    
                                     var bindArgs = {
                                     transport: "IframeTransport",
                                     formNode: formulario,
                                     handle: eval(function(type, data, evt) {
                                     dojo.debug('hecho', data);
                                     ${id}IFUEspera.style.display = 'none';
                                     ${id}IFUEsperaEnlace.style.display = 'inline';
                                     })
                                     };
                                     dojo.debug('Enviando...', bindArgs);
                                     req = dojo.io.bind(bindArgs);
                                     dojo.debug('Enviado el envÃÂo...', bindArgs);
                                     return false;
                                     }
                                     //]]>
                                     </script>
                                     </f:verbatim>
                                    
                                     </a4j:outputPanel>
                                     <t:message rendered="${!displayValueOnly}" for="${id}_infiup" />
                                     </a4j:outputPanel>
                                     </a4j:outputPanel>
                                     </ui:composition>