user3172567
user3172567

Reputation: 471

Primefaces 5 overlayPanel broken after update

Today I discovered a new bug in P5. When I update the button which the overlay panel is referring to, it doesn't work anymore - The overlaypanel is not shown anymore.

As a workaround I do use PF('widgetVar').loadContents(); but this feels very uncomfortable.

In PF4 this did work without any workarounds.

Anyone got some solution?

Upvotes: 3

Views: 2297

Answers (2)

Martin Volek
Martin Volek

Reputation: 315

My solution:

  • don't update single button that opens overlay, update both
  • also add dismissable="false" showCloseIcon="true"
  • in the case you are using overlay on a dialog: add appendTo="@(body)"

Example code:

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

Upvotes: 1

LarsBauer
LarsBauer

Reputation: 1535

I don't know exactly what you are pointing at. What do you mean with updating the button?

For me the following code works fine with PrimeFaces 5.0:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
    xmlns:pm="http://primefaces.org/mobile">
<h:head>
</h:head>
<h:body>
    <p:commandButton id="menuButton" value="Menu" icon="ui-icon-home"/>

    <p:overlayPanel for="menuButton" widgetVar="menuPanel" at="left" showEffect="push">
        <!-- overlayPanel content goes here -->
    </p:overlayPanel>
</h:body>
</html>

Does this help you with your problem?

Upvotes: 0

Related Questions