I have PrimeFaces dialog, which is centered:
<p:dialog header="Contact Information" widgetVar="companyAl"
modal="false" position="center center">
When I open it using:
PF('companyAl').show();
it will appear on the screen center. However, when I drag it somewhere else, close it and reopen it again, it will appear again in the last position before closing instead of on the screen center. How to force it to appear always on the screen center after
PF('companyAl').show();
?
You could also simply add an onShow
attribute to the dialog:
<p:dialog header="Contact Information" widgetVar="companyAl"
modal="false" position="center center"
onShow="PF('companyAl').initPosition()">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With