My usecase is showing a confirm dialog for a delete yes/no. The dialog + buttons work. The dialog is shown and hidden as appropriate, and logic executed (entry deleted, growl message shown, view refreshed, etc, etc).
The problem is that the dialog creates duplicates of itself, with the same messages but without the buttons.
A new copy is created every time the dialog is shown again. So for every call to .show() an extra empty dialog is added (with the same message+header as the one with the buttons).
Is this a bug or is there an error in the way I am displaying the ConfirmDialog?
The confirm dialog is part of a composite component which provides a "DeleteButton" with the appropriate logic / properties:
Code: Select all
<p:commandButton image="#{cc.attrs.deleteButton.icon}" title="#{cc.attrs.deleteButton.name}"
onclick="dialog.show()" disabled="#{cc.attrs.deleteButton.disabled}"
immediate="#{cc.attrs.deleteButton.immediate}"/>
<p:confirmDialog widgetVar="dialog" message="#{cc.attrs.deleteButton.dialogMessage}"
header="#{cc.attrs.deleteButton.dialogHeader}" severity="alert"
showEffect="fade" hideEffect="fade" closable="false">
<p:commandButton value="#{cc.attrs.deleteButton.confirmButtonText}" update="@form"
process="@form" oncomplete="dialog.hide()"
actionListener="#{cc.attrs.deleteButton.dialogConfirmClick}" />
<p:commandButton value="#{cc.attrs.deleteButton.cancelButtonText}" ajax="true" update="@form"
onclick="dialog.hide()" immediate="true"/>
</p:confirmDialog>