This content has been marked as final.
Show 3 replies
-
1. Re: How to open the rich:fileupload file browser window from javascript
ilya_shaikovsky Apr 26, 2010 11:17 AM (in response to babazs)this will not works in general. some workarounds like:
<h:form id="form"> <h:panelGrid columns="2" columnClasses="top,top"> <rich:fileUpload fileUploadListener="#{fileUploadBean.listener}" maxFilesQuantity="#{fileUploadBean.uploadsAvailable}" id="upload" immediateUpload="#{fileUploadBean.autoUpload}" acceptedTypes="jpg, gif, png, bmp" allowFlash="#{fileUploadBean.useFlash}"> <a4j:support event="onuploadcomplete" reRender="info" /> </rich:fileUpload> <a href="#" onclick="jQuery(document.getElementById('form:upload:file')).trigger('click')">Click</a>
exsit(just move the code to onshow handler). but it's not cross-browser solution. and there is nothing to do with RichFaces. just input type='file' has some security restrictions which are implemented diferently for different browsers. E.g. in FireFox you will not be able to click the upload button from js. But it will works fine for IE and Chrome.
-
2. Re: How to open the rich:fileupload file browser window from javascript
babazs Apr 26, 2010 11:39 AM (in response to ilya_shaikovsky)thankx.
-
3. Re: How to open the rich:fileupload file browser window from javascript
moe Apr 21, 2013 5:09 AM (in response to babazs)Hi,
I have tested this in my project, but it don't work. Are there changes in RichFaces since 2010 in the FileUload?
Can you help me?
Thanks Moe