Jsf RequestContext.getCurrentInstance().openDialog()在PrimeFaces 5.1中不起作用
Iam正在尝试实现primefaces对话框框架。但是没有对话框。Iam使用SpringWebflow2.3.2和JSF2.1.3 主机Xthml页面中的我的代码:Jsf RequestContext.getCurrentInstance().openDialog()在PrimeFaces 5.1中不起作用,jsf,jsf-2,primefaces,dialog,requestcontext,Jsf,Jsf 2,Primefaces,Dialog,Requestcontext,Iam正在尝试实现primefaces对话框框架。但是没有对话框。Iam使用SpringWebflow2.3.2和JSF2.1.3 主机Xthml页面中的我的代码: <p:commandButton process="@this" ignoreAutoUpdate="true" title="#{displayManager.getFieldLabel('ADD_NEW_SITE')}" update="@th
<p:commandButton process="@this" ignoreAutoUpdate="true" title="#{displayManager.getFieldLabel('ADD_NEW_SITE')}"
update="@this" styleClass="add_feature" actionListener="#{managePatientTO.runtimeDialog}"
icon="ui-icon-plus">
Java代码:
public void runtimeDialog(ActionEvent event) {
System.out.println("--------------------> Open Dynamic Dialog <----------------------");
Map<String,Object> options = new HashMap<String, Object>();
options.put("modal", true);
options.put("draggable", false);
options.put("resizable", false);
options.put("contentHeight", 320);
RequestContext.getCurrentInstance().openDialog("identifierDialog", options, null);
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "What we do in life", "Echoes in eternity.");
RequestContext.getCurrentInstance().showMessageInDialog(message);
}
公共无效运行时对话框(ActionEvent事件){
System.out.println(“----------------------->同时使用SpringWebFlow和JSF导航规则打开动态对话框听起来像是可能的问题(没有经验,只是一种预感)。但在这种情况下,可能是对话框框架不使用导航规则(“identifierDialog”)“未“映射”到/flows/managePatientDashboard/identifierDialog.xhtml
。因此,请尝试将页面置于openDialog方法中。我也尝试过(
<?xml version='1.0' encoding='UTF-8'?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<application>
<resource-bundle>
<base-name>app.PCMHMessages</base-name>
<var>pcmhMessages</var>
</resource-bundle>
<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>identifierDialog</from-outcome>
<to-view-id>/flows/managePatientDashboard/identifierDialog.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<!-- <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> -->