我正在使用modal= true
和appendToBody=true
在我的对话框中,它在 Chrome 和 Firefox 中运行良好,但在 IE8 中运行良好。对话框出现了,但是如果我关闭对话框,背景仍然是蓝色的,因为modal=true
,但我必须使用它。
这是我的代码:
<ui:composition template="../templates/site.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:sec="http://www.springframework.org/security/tags">
<ui:define name="content">
<h:form id="form">
<p:commandButton value="Button" type="button" id="myButton"
onclick="form:testDialog.show()" />
<p:dialog id="testDialog" widgetVar="testDialog"
header="My Test Dialog" modal="true" appendToBody="true">
<h:form>
<p:fieldset legend="Dialog">
<p:spacer height="30" />
</p:fieldset>
</h:form>
</p:dialog>
</h:form>
</ui:define>
</ui:composition>
编辑:
问题是对话框的命名。ID 和 widgetVar 不能同名。与此帖相关