今天我发现了P5的一个新bug。当我更新覆盖面板所指的按钮时,它不再起作用 - 覆盖面板不再显示。
作为解决方法,我确实使用了 PF('widgetVar').loadContents();
但这感觉非常不舒服。
在 PF4 中,这确实有效,没有任何变通办法。
有人有解决办法吗?
最佳答案
我的解决方案:
- 不要更新打开叠加层的单个按钮,同时更新两个
- 同时添加
dismissable="false"showCloseIcon="true"
- 如果您在对话框上使用覆盖:添加
appendTo="@(body)"
示例代码:
<p:commandButton value="updateSection" update=":form:overlayPanelGroup" />
<h:panelGroup id="overlayPanelGroup">
<p:commandButton id="openOverlayBtn" process="@this" value="openOverlay"/>
<p:overlayPanel for="openOverlayBtn" showEffect="fade" hideEffect="fade" dismissable="false" showCloseIcon="true" appendTo="@(body)">
<h:outputText value="textSample"/>
</p:overlayPanel>
</h:panelGroup>
关于jsf - 更新后 Primefaces 5 overlayPanel 损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23695239/