Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primefaces Dialog Framework Liferay

Primefaces Dialog Framework opens the same portlet page instead of required page.

<p:commandButton value="Dialog" process="@this" icon="ui-icon-extlink" actionListener="#{controller.viewDialog}" />

Bean:

public void viewDialog() {
    Map<String,Object> options = new HashMap<String, Object>();
    options.put("modal", true);
    options.put("draggable", false);
    options.put("resizable", true);
    options.put("contentHeight", 320);

    RequestContext.getCurrentInstance().openDialog("viewDialog", options, null);    

viewDialog.xhtml:

<f:view xmlns="http://www.w3.org/1999/xhtml"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:portlet="http://java.sun.com/portlet_2_0">
<h:head />
<h:body styleClass="jsf2-portlet">
    <f:event type="preRenderView" listener="#{dialog.initController}" />

</h:body>

like image 312
rjomir Avatar asked Mar 12 '15 15:03

rjomir


2 Answers

if not then add Navigation Rule for "viewDialog" in your faces-config.xml which references viewDialog.xhtml.

<application>

    <action-listener>org.primefaces.application.DialogActionListener</action-listener>
    <navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
    <view-handler>org.primefaces.application.DialogViewHandler</view-handler>

</application>


<navigation-rule>
        <from-view-id>*</from-view-id>
        <navigation-case>
            <from-outcome>viewDialog</from-outcome>
            <to-view-id>{path}/viewDialog.xhtml</to-view-id>
        </navigation-case>
</navigation-rule>
like image 87
Bhavin Panchani Avatar answered Sep 21 '22 08:09

Bhavin Panchani


This is caused by a bug described at the Liferay forum and the issue FACES-2168.

I was not able to only use the corrected faces-impl with the old liferay (6.1.1).

like image 26
ACV Avatar answered Sep 19 '22 08:09

ACV