Close modal JSF

Asked

Viewed 514 times

0

I need to do mine deleteConfirmationModal close.
It only works by clicking on NAY.

I need to make him perform the action of YES and close the modal.

<p:commandLink title="#{label.REMOVE}" process="@this" styleClass="btn-remove" oncomplete="deleteConfirmationModal.show();"/>
<p:confirmDialog message="#{label.DELETE_CONFIRMATION_MESSAGE}"
                 header="#{label.HEADER_DELETE_CONFIRMATION_MODAL}" severity="alert"
                 widgetVar="deleteConfirmationModal" id="deleteConfirmationModalId">
    <p:commandLink value="#{label.YES}"
                   oncomplete="deleteConfirmationModal.hide();"
                   action="#{controller.actionRemove(item)}"
                   styleClass="btn-save"
                   id="buttonYesOption"
                   update="@form, deleteConfirmationModalId">
    </p:commandLink>
    <p:commandLink value="#{label.NOT}"
                   onclick="deleteConfirmationModal.hide()"
                   styleClass="btn-cancel"
                   id="buttonNotOption" />
</p:confirmDialog>
  • What version of Primefaces are you using? Larger than 5?

  • Solution posted 2 minutes after question?

  • What’s the problem? The site allows you to ask questions with solutions.

1 answer

-1


I added the onclick="deleteConfirmationModal.hide()" on the button YES

  • I don’t think that’s the best way to do it. The oncomplete probably work if you do oncomplete="PF('deleteConfirmationModal').hide()"

  • I’ll try to do that.

  • Cool! This will work if the prime version is > 5

  • Solution posted 2 minutes after question?

  • 1

    @This has no problem (from the point of view of the site). But the answer could be better elaborated

  • @The site allows you to ask questions with solutions.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.