0

Hi evryone i have a problem with ConfirmDialog i ma using Primeface 4 and when i try to use ConfirmDialog doesn't work the small window of confirmation come but it's block and don't work and you can't click on it here is the small code. I am trying to do a confirmation before delete

<h:form prependId="false">

<p:contextMenu for="dataTable">
<p:menuitem value="View" update="display" icon="ui-icon-search"
oncomplete="utilisateur.show()" />
<p:menuitem value="Delete" icon="ui-icon-close"
onclick="confirmation.show()" />
</p:contextMenu>

<p:dataTable id="dataTable" var="user" value="#{usersBean.u}"
paginator="true" rows="10"
rowKey="#{user.idUtilisateur}" 
selection="#{usersBean.selectUser}" selectionMode="single"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="3,5,10,15">
<f:facet name="header">

<p:confirmDialog id="confirmDialog"
message="Are you sure about about deleting this?"
header="Initiating delete process" severity="alert"
widgetVar="confirmation">

<p:commandButton id="confirm" value="Yes Sure" update="dataTable"
oncomplete="confirmation.hide()"
actionListener="#{usersBean.deleteUser}" />
<p:commandButton id="decline" value="Not Yet"
onclick="confirmation.hide()" type="button" />

</p:confirmDialog>

</f:facet>

Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40

2 Answers2

1

did you try to modify css style? I tryed this and the confirm dialog work but it isn't modal.

 .ui-widget-overlay{
     visibility: hidden;
 }

Maybe this will also help PrimeFaces commandButton in confirmDialog not calling backing bean

Community
  • 1
  • 1
jesusnoseq
  • 341
  • 4
  • 9
  • Where did you add it? – kenadet Mar 29 '18 at 15:21
  • The right answer is this one https://stackoverflow.com/a/8971087/1542778 but if you don't want to do that... To any css that is added to the page but make sure you override the css rule from primefaces. You could also use z-index property. – jesusnoseq Apr 03 '18 at 20:05
0

Add appendToBody="true" in your p:confirmDialog

David H.
  • 953
  • 1
  • 8
  • 20