Forums de discussion

Problem with Upload and Navigation

Lisa Gunkel, modifié il y a 12 années.

Problem with Upload and Navigation

New Member Publications: 23 Date d'inscription: 26/10/10 Publications récentes
Hi folks,
I’m working with Liferay 6.0.6 CE for a little while now. Currently, my task is to create a portlet using ICEfaces 2.0.1 (http://www.icefaces.org/main/downloads/os-downloads.iface) and the Portletfaces bridge.

My portlet is supposed to allow file uploads. I found a working example (http://www.liferay.com/community/liferay-projects/liferay-faces/demos#jsf2-portlet).
In this example, the upload is implemented in portletModeView.xhtml and works for me. However, my task is to link to another page and implement the upload in that second page. So basically I’ve changed the xhtml page to look like this:


<!--?xml version="1.0" encoding="UTF-8"?-->
<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head />
    <h:body styleclass="icefaces2-portlet ltr">
        <ui:include src="styling.xhtml" />
            <h:form id="f1">
        <h:commandlink action="/xhtml/show.xhtml" immediate="true" value="just continue" /> </h:form>
    </h:body>
</f:view>


And then I created a new page, the linked page, named show.xhtml, like this:


<!--?xml version="1.0" encoding="UTF-8"?-->
<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head />
    <h:body styleclass="icefaces2-portlet ltr">
        <ui:include src="styling.xhtml" />
        <ui:include src="applicant.xhtml" />
    </h:body>
</f:view>


Like in the original example, the upload itself is provided by applicant.xhtml, and there it looks like this (snippet):


            <h:form id="f1">
                <aui:column id="c2a" styleclass="uploaded-files">
                .......

                    <ace:fileentry id="fileEntryComp" absolutePath="#{applicantBackingBean.fileUploadAbsolutePath}" fileEntryListener="#{applicantBackingBean.fileEntryListener}" />
                    <h:commandbutton value="#{i18n['add-attachment']}" " />
                </aui:column>
            </h:form>


I was thinking that by moving the include from the original page to a second, linked page, the upload should nonetheless work. However, this is not the case. The method fileEntryListener is no longer called. Navigation goes directly (back) to portletModeView.xhtml and there is no upload.
Apparently I can’t get it to work this way. In our scenario, however, we need the upload to take place in a second page, and not directly on the first page, as in the original (working) example.
Can anyone help to clarify this? Do I have to add something to the upload in order to make it stay on the second page (and thus have my method called), or anything like that? Or do we have some sort of bug or flaw, here?
Any help is greatly appreciated.
Have a nice day,
Lisa
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: Problem with Upload and Navigation

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
@Lisa: I'm reviewing some old forum posts and I'm sorry that I missed getting back to you on this.

Does the problem you describe in this forum post look like the same thing as FACES-238?