Question
TapRoot Solutions LLC
US
Last activity: 16 May 2017 18:49 EDT
Confirm message on Close Modal dialogue
Hi,
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.
Any response is appreciated.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
To elaborate
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!
<script>
function showWarning() {
alert("in show warning");
var ans = confirm("Do you want to close ?");
if (ans)
doModalAction(pega.u.d.submitModalDlgParam,event);
else
return;
}
</script>
Pegasystems Inc.
US
Hi Sharath,
Can you try to launch an overlay on top of a Modal Dialog?
Thanks,
Susan
TapRoot Solutions LLC
US
I did try this, but I cannot close the first modal. the close only closes the overlay.
Pegasystems Inc.
US
Pega only support : Just one modal dialog can be opened at a time.
-
KOTTURU VEERA LOHITH vamsi muvvala
Pegasystems Inc.
US
Similar issue reported here :
Of course, there it is a delete on a repeat grid.
In your case, I would suggest the following (try please, I have not tested)
1. Override the Ok and Cancel buttons displayed on the modal dialog
2. Use it to run Script like shown in the other community post.
3. Based on the answer , call the activity to either close the modal dialog or remain
Accepted Solution
Pegasystems Inc.
US
To elaborate
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!
<script>
function showWarning() {
alert("in show warning");
var ans = confirm("Do you want to close ?");
if (ans)
doModalAction(pega.u.d.submitModalDlgParam,event);
else
return;
}
</script>
TapRoot Solutions LLC
US
thank you ! this is a good script that can link the modal in a modal.