I am using PrimeFaces 2.1 to show a dialog like this:
<p:dialog header="Test" modal="true" showEffect="fade" hideEffect="fade" widgetVar="dlgTest" resizable="false" closable="false" width="500">
<!-- dialog content -->
</p:dialog>
Everything is ok but I also want that the dialog can’t be closed (thats why I used “closable” false)
The problem is: when the dialog appears and the user press ESC, the dialog gets closed (skipping the closable property)
Any idea to solve this or is it a bug of Primefaces? I think closable property just remove the (X) from the dialog and has no sense!
Just to know: I tried to use jQuery and restrict the ESC key evaluating the keychar (27) in the interface but it has no effect when the dialog appears (it works just for the interface body)
Thanks!
There is a
closeOnEscapeattribute forp:dialogwhich defaults totrue.Try the following: