Primefaces 对话框框架 Liferay

标签 primefaces liferay dialog-framework

Primefaces Dialog Framework 打开相同的 portlet 页面而不是所需的页面。

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

bean 角,扁 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);    

View 对话框.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>

最佳答案

如果没有,则在引用 viewDialog.xhtml 的 faces-config.xml 中为“viewDialog”添加导航规则。

<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>

关于Primefaces 对话框框架 Liferay,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29013726/

相关文章:

jakarta-ee - Primefaces 组件在 websphere 8.5 中不起作用

jsf - 将图标添加到 p :panel?

liferay - 在Liferay上修改控制面板的权限

ajax - 使用 ajax 监听器时 Primefaces 对话框框架不起作用

Primefaces 关闭模式而不隐藏对话框

JSF PrimeFaces - 单击按钮时保存所选表格单元格的值

ssl - 在安全页面上使用 http 的 Liferay CSS URL

workflow - 如何在“分配到组合框”上获取 Kaleo 工作流程中的所有用户列表?

使用对话框框架的primefaces 对话框没有弹出