Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
Axel Nagel
Weired Problem with FileUpload example
10 de abril de 2012 16:00

Axel Nagel

Ranking: New Member

Mensajes: 20

Fecha de incorporación: 2 de septiembre de 2009

Mensajes recientes


I'm testing the JSF Portlet Bridge with liferay6.0, tomcat for a scientific project:
I tried to create a simple upload Portlet and came to the following problem.
The upload only works if I add a second form with the same id in a separate layout.
Without the second form I get the HtmlInputFile but the UploadedFile is null.
It seems there is no full submit without the second form.

I would be very grateful about any hint how to get a full submit going without the second form.
This seems to be related to where the problem hasn't been resolved (switched to ace:fileEntry instead).


p.s: The forum seems to be broken, I wrote the post serveral times and everything vanished when pressing preview or save as draft ????

I trimmed the code from this example:

 2<?xml version="1.0"?>
 4<f:view xmlns:f=""
 5    xmlns:h=""
 6    xmlns:ui=""
 7    xmlns:p=""
 8    xmlns:aui="">
 9    <h:head />
10    <h:body>
11        <p>Upload your data sets.</p>
12        <aui:layout id="l1">
13            <h:form id="f1">
14            </h:form>
15        </aui:layout>
16        <aui:layout id="l2">
17            <h:form enctype="multipart/form-data" id="f1" method="POST">
18                <p:inputFile binding="#{uploadController.uploadedFile}" />
19                <h:commandButton actionListener="#{uploadController.upload}"
20                    value="upload" />
21            </h:form>
22        </aui:layout>
23    </h:body>

 6import javax.faces.bean.ManagedBean;
 7import javax.faces.bean.RequestScoped;
 8import javax.faces.event.ActionEvent;
10import org.portletfaces.bridge.component.HtmlInputFile;
12@ManagedBean(name = "uploadController")
14public class UploadController implements Serializable{
15    /**
16     *
17     */
18    private static final long serialVersionUID = 1L;
19    private transient HtmlInputFile uploadedFile;
21    public void setUploadedFile(HtmlInputFile uploadedFile) {
22        this.uploadedFile = uploadedFile;
23    }
25    public HtmlInputFile getUploadedFile() {
26        return uploadedFile;
27    }
29    public void upload(ActionEvent actionEvent) {
30        System.out.println("uploading now + " + uploadedFile.toString() + "!!");
31        try {
32            if (uploadedFile.getUploadedFile() != null)
33                System.out.println("uploading now + "
34                        + uploadedFile.getUploadedFile().toString() + "!!");
35            else
36                System.out.println("empty upload");               
37        } catch (Exception e) {
38            e.printStackTrace();
39        }
40    }
Johann Kneringer
RE: Weired Problem with FileUpload example
30 de noviembre de 2011 6:20

Johann Kneringer

Ranking: Junior Member

Mensajes: 42

Fecha de incorporación: 10 de noviembre de 2011

Mensajes recientes

Did you find a solution for this?
Axel Nagel
RE: Weired Problem with FileUpload example
30 de noviembre de 2011 6:40

Axel Nagel

Ranking: New Member

Mensajes: 20

Fecha de incorporación: 2 de septiembre de 2009

Mensajes recientes


As far as I remember from that time and don't pin me on that:

ICEFACES clashed with the liferay 6 server, I haven't looked into it, if that is already fixed.
I ran some of the icefaces examples using liferay 6. and 5.3.2.
I also downloaded the the community edition of the liferay icefaces eclipse plugin 6.1 and found different version of the libraries used there.
I also combined exchanged libraries of different version and got the file upload working , sorry can't remember which version, but anyway that rendered other parts of the icefaces not working.

So spending some days on it I decided it to be currently unfit, even if liked to have used it.

See this section for some clarification:

ACE Portlets
With the exception of the File Entry component, ACE components do not currently run on Liferay due to a YUI library conflict. This will be rectified in a later release. See ICEfaces 2.0.0 Release Notes for a full list of issues pertaining to portlets and ICEfaces 2.

If you find out that things work out with a new release I would be glad to here as I like the general concept.

Neil Griffin
RE: Weired Problem with FileUpload example
8 de mayo de 2012 8:43

Neil Griffin


Ranking: Liferay Legend

Mensajes: 2497

Fecha de incorporación: 26 de julio de 2005

Mensajes recientes


If you get a chance, please try this with Liferay Faces Bridge. If it's still a problem, then please modify the jsf2-portlet or icefaces3-portlet demo so that it reproduces the problem and then upload it here.

Also, I wanted to point out that Liferay Faces Bridge also supports the PrimeFaces p:fileUpload component with multi-file Ajax upload. See the primefaces3-portlet demo for more details.