我正在尝试在我的 JSF 页面中使用Primefaces Dialog组件显示警报。我可以显示对话框,但我的问题在于该对话框的透明度/不透明度。我已经通过设置覆盖了对话框的样式属性opacity: 1.0
,但它不起作用。我想放弃对话框的透明度。我怎样才能以简单的方式实现这一目标?
我的 JSF 页面:
<f:view xmlns="http://www.w3.org/1999/xhtml"
....
renderKitId="PRIMEFACES_MOBILE">
....
<pm:page title="Mobile Reports">
<pm:view id="reports" swatch="b">
<h:form>
<pm:content>
<div>
<h:form>
....
<p:dialog id="myDialog"
header="ERROR"
widgetVar="dlg"
modal="true"
style="opacity: 1.0;"
appendToBody="true">
<p:commandButton id="decline" value="Couldn't display the report!"
onclick="dlg.hide()" type="button" />
</p:dialog>
....
<p:commandButton id="contractInfo" action="ContractInfo.xhtml"
value="Contract Information" style="width:100%;"
onerror="dlg.show();">
</p:commandButton>
....
</h:form>
</div>
</pm:content>
</h:form>
</pm:view>
</pm:page>
</f:view>
输出:
GPRS 显示在 JSF 页面中,它不是对话框的一部分。但是,它是可见的,因为对话框是透明的。
注意: 我使用的是primefaces-mobile-0.9.3.jar