-
1. Problem with FileUpload RichFaces 4
jbalunas Feb 21, 2011 4:35 PM (in response to r.silva)Are you running MyFaces? There are known MyFaces issues with file upload.
-
2. Problem with FileUpload RichFaces 4
r.silva Feb 21, 2011 4:40 PM (in response to jbalunas)Yes, I'm running MyFaces...
myfaces-api-2.0.3.jar
myfaces-impl-2.0.3.jar
Thank's for Help...
-
3. Problem with FileUpload RichFaces 4
r.silva Feb 22, 2011 8:21 AM (in response to r.silva)I found this article:
http://community.jboss.org/wiki/richfileUploadwithMyFaces
...but RichFaces is for version 3. How does RichFaces to work on version 4??
Thank's
-
4. Problem with FileUpload RichFaces 4
jbalunas Feb 23, 2011 10:52 AM (in response to r.silva)Unfortunatly for MyFaces and RichFaces 4, we need updates in MyFaces. We'll keep an eye on it, and update when it is available.
-Jay
-
5. Re: Problem with FileUpload RichFaces 4
t_guen03 Mar 3, 2011 5:16 PM (in response to r.silva)Hi,
I have the same problem. But I use Mojarra instead of MyFaces.
Following my setup:<rich:fileUpload fileUploadListener="#{uploadBean.test}" id="upload" acceptedTypes="jpg, gif, png, bmp" />
void test(FileUploadEvent event) throws Exception { UploadedFile file = event.getUploadedFile(); System.out.println("Uploaded : " + file.getName()); }
If i add an item to the fileupload component and click upload, nothing happens.
It would be very nice if someone could tell me, whats the reason for this.
Thanks for your help
-
6. Problem with FileUpload RichFaces 4
adamo901 Apr 17, 2011 3:20 PM (in response to t_guen03)I also have the same problem using Glassfish 3.1 (with Mojarra 2.1)
The progress bar is showen but doesn't start even if the function:
public void listener(FileUploadEvent event) throws Exception {}
is working perfectly!!!!!
Is there any thing I can do?
-
7. Problem with FileUpload RichFaces 4
ilya_shaikovsky Apr 18, 2011 4:22 AM (in response to adamo901)you using Final version? Any JS errors?
-
8. Problem with FileUpload RichFaces 4
adamo901 Apr 18, 2011 5:07 AM (in response to ilya_shaikovsky)I am using the final version of Richfaces4.0 and I get no js error
There is only one tag in my xhtml page :
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich" >
<h:body>
<h:form>
<rich:fileUpload fileUploadListener ="#{fileUploadBean2.load}"/>
</h:form>
</h:body>
</html>Every thing is displayed correctly except the progress bar that is showen when I click on upload but doesn't change and remains empty even if the file is well uploaded by :
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
@Named
@SessionScoped
public class FileUploadBean2 implements Serializable {
public void load(FileUploadEvent event) throws Exception {
UploadedFile item = event.getUploadedFile();
try {
DataInputStream in = new DataInputStream(item.getInputStream());
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) {
/ / some processing that behaves correctly!!
}
in.close();
} catch (Exception ex) {
System.out.println(ex);
}
}
}
Can you please help about this!
-
9. Re: Problem with FileUpload RichFaces 4
ahmed_samir Apr 22, 2011 8:10 AM (in response to adamo901)@Ilya ....
really i used your code on the richfaces show case ...
but when i tried it on my machine it give me some out put ..
<rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"
id="upload" acceptedTypes="jpg, gif, png, bmp">
<a4j:ajax event="uploadcomplete" execute="@none" render="uploadPanel" />
</rich:fileUpload>
public void listener2(FileUploadEvent event) throws Exception {
System.out.println("loadingfile");
UploadedFile file = event.getUploadedFile();
String invoiceFile = file.getName();
System.out.println("fileInformation loaded = " + invoiceFile);
}
it actually give me the file name .. but the upload file componenet didn't change ...
and in another code ... i copied the file from stream to the image directory and it was perfect ... but still the problem whith in the component
so can you please help me about this ... i used prime faces ... but it didn't give me any respone .. event any action from the fileUploadBean
-
10. Re: Problem with FileUpload RichFaces 4
ilya_shaikovsky Apr 22, 2011 9:46 AM (in response to ahmed_samir)please create simple war sample(or maven based project sources would be ideal).. should be something obvious in configuration I guess.. we will run it locally and check..
then you could attach there or crete jira issue and place there.
-
11. Re: Problem with FileUpload RichFaces 4
ahmed_samir Apr 24, 2011 12:46 PM (in response to ilya_shaikovsky)ok ilya ... here is the war file ... it give the name of the file in the output screen .
I use netbeans 7.0 ....
and I depoly it on tomcat 7.0.12
-
WebApplication2.rar 7.0 MB
-
-
12. Re: Problem with FileUpload RichFaces 4
ahmed_samir Apr 24, 2011 12:59 PM (in response to ilya_shaikovsky)ok ilya here is the war file ... I removed the libraries from the war file for size purpose... and you will find an image contains libraries name ..
so notify my if i was using a wrong version .
and you will find the beans I was using in .java files
-
webApp.rar.zip 21.1 KB
-
-
13. Re: Problem with FileUpload RichFaces 4
ilya_shaikovsky Apr 25, 2011 2:27 AM (in response to ahmed_samir)at first I do not see RF fileUpload used across pages.. only PF one. but anyway - had one more suggestion - please try it out without PF added to the project. If will works fine - it means that there is some compatibility problems. (maybe for example both libs bases on jQuery but has different versions or something like that). Then if so create an issue for that particular compatibility case.
-
14. Re: Problem with FileUpload RichFaces 4
ahmed_samir Apr 25, 2011 2:47 AM (in response to ilya_shaikovsky)great ilya ... Thank you very much .... any way the pf component was not working with me ... I expected that but I didn't know why they reflect together .
any way thnx 4 your support.