2

我正在尝试实现 primefaces 对话框框架。但坚持没有对话框。我正在使用 spring webflow 2.3.2 和 JSF 2.1.3。

我来自主机 Xthml 页面的代码:

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

    }

虽然 showMessageInDialog 工作正常。

面对 config.xml

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

我几乎尝试了一切。寻求帮助

4

0 回答 0