File Upload component problem

UI Components for JSF
Post Reply
Lalib
Posts: 10
Joined: 19 Feb 2011, 00:11

19 Feb 2011, 17:08

Hi, I've just started jsf and primefaces. I'm getting a problem while using file upload component. The actionlistener property doesn't invoke the action method in bean file.
Here are my codes:

index.xhtml

Code: Select all

<h:form>
            <p:growl id="messages" showDetail="true"/>
            <p:fileUpload allowTypes="*.jpg;" fileUploadListener="#{uploadbean.handleFileUpload}" label="Resim Yükle"/>
 </h:form>
uyelik.java

Code: Select all

@Named
@RequestScoped
public class uploadbean {

    public void handleFileUpload(FileUploadEvent fEvent) {
        System.out.print("heyyyyyyyyyyyyy");
        System.out.print(fEvent.getFile().getFileName().toString());
        FacesMessage msg = new FacesMessage("Succesful", fEvent.getFile().getFileName() + " is uploaded.");
        FacesContext.getCurrentInstance().addMessage(null, msg);
    }
}
It doesnt show any message and i cant see anything in console.
Waiting for your helps.

Bilal
Majorra 2.1.2 + Primefaces 3.0 m2

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Feb 2011, 22:00

FileUpload is rewritten as of 3.0, the one in 2.2 had issues as it was flash based, give new one a shot with a 3.0 nightly build;

http://www.primefaces.org/showcase-labs ... adHome.jsf

Lalib
Posts: 10
Joined: 19 Feb 2011, 00:11

20 Feb 2011, 23:21

when can i use fixed one? I couldn't see download link.
Majorra 2.1.2 + Primefaces 3.0 m2

vhtc
Posts: 1
Joined: 22 Feb 2011, 15:37

22 Feb 2011, 15:42

there is a considerable problem when using the primefaces 3.0 file upload component. if you use it's advanced mode in more than one component in one single page, it won't work.

'uncaught exception: FileUpload with namespace "file_upload" already assigned to this element'

did anyone find a solution for that?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 63 guests