Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 将模式p:对话框与另一个模式p:对话框重叠_Jsf_Primefaces - Fatal编程技术网

Jsf 将模式p:对话框与另一个模式p:对话框重叠

Jsf 将模式p:对话框与另一个模式p:对话框重叠,jsf,primefaces,Jsf,Primefaces,首先-我是PrimeFaces新手,我正在尝试在另一个已经生成的对话框上显示一个警告对话框 查看代码如下所示(简化): warnDialog已正确生成,但显示在userDialog对话框下方,而不是上方 应用程序正在使用PrimeFacesV6.0 org.primefaces.webapp.PostConstructApplicationEventListener.processEvent在primefaces 6.0上运行 编辑: 测试的confirmDialog代码(简化)如下:

首先-我是PrimeFaces新手,我正在尝试在另一个已经生成的对话框上显示一个警告对话框

查看代码如下所示(简化):

warnDialog
已正确生成,但显示在
userDialog
对话框下方,而不是上方

应用程序正在使用PrimeFacesV6.0
org.primefaces.webapp.PostConstructApplicationEventListener.processEvent在primefaces 6.0上运行

编辑:

测试的
confirmDialog
代码(简化)如下:

    <p:dialog id="userDialog" header="User Account" widgetVar="userDialogView" modal="true" resizable="true" closable="fasle" showHeader="true" height="400" width="880px">
        <h:form id="dataDialogForm">
         ...
        <p:confirmDialog widgetVar="warnDialog" header="Confirmation" severity="warn" modal="true" resizable="false" position="top,left">
                <f:facet name="message">
                    You are trying to delete. Do you want to proceed?
                </f:facet>
                <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="pi pi-check" />
                <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="pi pi-times" />
            </p:confirmDialog>

        </h:form>
    </p:dialog>

...
您正在尝试删除。你想继续吗?

这一个没有在
userDialog
上生成阻塞覆盖,也没有定位到视口的左上角,而不是触发
confirmDialog

的元素,我通过覆盖PrimeFaces CSS解决了我的问题,由于某种原因,它没有正确处理覆盖对话框(与5.x版和6.x版的普通jQueryUI或引导程序相比)

我的解决方案如下所示:

<p:dialog id="userDialog" header="User Account" widgetVar="userDialogView" modal="true" resizable="true" closable="fasle" showHeader="true" height="400" width="880px">
    <h:form id="dataDialogForm">
     ...
    </h:form>
</p:dialog>

<p:dialog id="warnDialog" header="Warning!" widgetVar="warnDialog" modal="true" height="300px" width="600px" resizable="false" styleClass="dialogWarn-fix">
    <h:outputText value="You are trying to delete. Do you want to proceed? Yes/No" />
</p:dialog>

如果两者都有一个
appendTo
,你的版本信息又是什么呢?也许你应该把第二点的appendTo指向其他东西…@Kukeltje v5.3和我以前做过的
appendTo=“@(#userDialog)”
但也没有做这项工作。我也尝试了
confirmDialog
,该选项在其他对话框上方显示对话框,但没有阻塞覆盖。所以你尝试了PF 6.0、6.1、6.2甚至7.0,看看它是否在那里工作?只是想看看…@Kukeltje这是一个旧应用程序,只是想添加更多组件。@Kukeltje我给出了当第二个对话框嵌套在第一个对话框中时,在另一个对话框上显示该对话框,但生成第二个对话框时,阻止覆盖不起作用。
    <p:dialog id="userDialog" header="User Account" widgetVar="userDialogView" modal="true" resizable="true" closable="fasle" showHeader="true" height="400" width="880px">
        <h:form id="dataDialogForm">
         ...
        <p:confirmDialog widgetVar="warnDialog" header="Confirmation" severity="warn" modal="true" resizable="false" position="top,left">
                <f:facet name="message">
                    You are trying to delete. Do you want to proceed?
                </f:facet>
                <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="pi pi-check" />
                <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="pi pi-times" />
            </p:confirmDialog>

        </h:form>
    </p:dialog>
<p:dialog id="userDialog" header="User Account" widgetVar="userDialogView" modal="true" resizable="true" closable="fasle" showHeader="true" height="400" width="880px">
    <h:form id="dataDialogForm">
     ...
    </h:form>
</p:dialog>

<p:dialog id="warnDialog" header="Warning!" widgetVar="warnDialog" modal="true" height="300px" width="600px" resizable="false" styleClass="dialogWarn-fix">
    <h:outputText value="You are trying to delete. Do you want to proceed? Yes/No" />
</p:dialog>
.dialogWarn-fix {
    z-index: 9999 !important;
}