page with multiple tags of <p:fileUpload ../> doesn't work

Components, Ajax Framework, Utilities and More.
achalamalasetti
Posts: 9
Joined: 14 Dec 2011, 22:09

15 Dec 2011, 01:21

I have page with multiple tags <p:fileUpload ..>, as below

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui">
	<h:head>
	</h:head>
	<h:body>
		<h:form enctype="multipart/form-data">
			<h:panelGrid columns="2">
				<h:outputLabel value="File1"/>
	    			<p:fileUpload id="file1"  fileUploadListener="#{fileuploadBean.listenFile1}" auto="true" />

				<h:outputLabel value="File2"/>
	    			<p:fileUpload id="file2"  fileUploadListener="#{fileuploadBean.listenFile2}" auto="true" />

				<h:outputLabel value="File3"/>
	    			<p:fileUpload id="file3"  fileUploadListener="#{fileuploadBean.listenFile3}" auto="true"  />
			</h:panelGrid>    
		</h:form>
	</h:body>
</html>

Code: Select all

public class FileUploadBean {	
	public void listenFile1(FileUploadEvent event) {		
		System.out.println("listening for file1");		
	}
	public void listenFile2(FileUploadEvent event) {		
		System.out.println("listening for file2");		
	}
	public void listenFile3(FileUploadEvent event) {		
		System.out.println("listening for file3");		
	}
}
Only the last one (file3) triggers an upload to the server. unable to uplaod the file through file 1 and file 2 tags above.

Not sure, what is wrong, any help in resolving this issue is greatly appreciated.

It worked in 3.0.M2.

Doesnot work in 3.0.M4 and 3.0.RC2-SNAPSHOT. Unable to test it with 3.0.RC1 because of the issue 3042

Primefaces Version: 3.0.M4, 3.0.RC2-SNAPSHOT
JSF Version: 2.0.4-b09
Server Tomcat: 6.0.29

mrzasa
Posts: 2
Joined: 28 Dec 2011, 16:51

28 Dec 2011, 16:53

I have similar problem. I have multiple tags <p:fileUpload> with auto=true and I have to upload file beginning from the last one. Otherwise nothing happened (post request is not sent). Has anyone found a solution for this issue?

User avatar
optimus.prime
Prime
Posts: 17421
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Dec 2011, 17:14

It is not supported.

achalamalasetti
Posts: 9
Joined: 14 Dec 2011, 22:09

28 Dec 2011, 17:53

It used to work in 3.0.M2, i have never migrated to 3.0.M3, but I think it works in there to. I haven't seen any documentation in the migration guide that states that this is no longer supported. To me it looks like a defect. If you have any wiki page or documentation on how it is supposed to work (fileupload.js looks like a cryptic code), that would be of great help. May be I can provide it back as a patch.

User avatar
optimus.prime
Prime
Posts: 17421
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Dec 2011, 21:19

It is not a defect, known limitation of advanced uploader, we will work on it after 3.0.

mrzasa
Posts: 2
Joined: 28 Dec 2011, 16:51

29 Dec 2011, 11:50

Thanks for quick answer. I'll resolve it by putting each fileUpload in separate form shown in a dialog.

noboundaries
Posts: 4
Joined: 13 Jun 2012, 07:54

13 Jun 2012, 10:29

So can't we put more than one file upload in a single Form?

Below is the similar one i posted,

viewtopic.php?f=3&t=22529&p=69454#p69454

Please suggest if we can overcome this in any way? Thing is I have to use two file uploads in auto mode in a single form.

thanks,

dhwanishahb
Posts: 14
Joined: 22 Jan 2013, 13:38
Location: Pune, India

27 Feb 2013, 14:28

Is this still not supported? I am using version 3.5 and facing the same issue when creating my file uploads using primefaces extension dynaform..
DhVaNi
++++++++++++++++++++++++++++++++++
PF 3.5, 4.0-SNAPSHOPT,
PF extensions 0.6.1, 0.7, 1.0-SNAPSHOT
Mojarra (JSF 2.0, 2.1)
Apache tomcat 7.0.x,

User avatar
optimus.prime
Prime
Posts: 17421
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

27 Feb 2013, 15:10

Same for 3.5, I plan to rewrite advanced uploader for 3.6, we'll see.

screemer
Posts: 5
Joined: 05 Jan 2012, 17:14

23 Jul 2013, 13:15

It would be very "nice feature" to have this kind of information inside documentation book.

Best regards,
Another person affected.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 4 guests