we have a requirement to show confirm message when user closes the modal dialogue. anyone has any idea to achieve this ? In a regular szcreen, Pega provides a OOTB feature to show this confirm but to achieve this in a modal dialogue is a challenge.
Hide the action section button from "Action" tab of your local action associated with the modal window.
copy the buttons from the pzModalTemplate to your section that is displayed in the modal window
Remove the Submit button and replace it with your own button, Add a action to call "RunScript"
Script can be included in the userWorkForm with the following (OR) something similar. I am not 100% sure about the doModalAction(pega.u.d.submitModalDlgParam,event) call. Just copied it off of the pzModalButton controls. It seems to work ok for my use case. As always TEST THOROUGHLY before use!