For closing modal dialog you can use pega.u.d.hideModalWindow java script function. However can you explain your exact use case what you are trying to achieve here. May be we can help with a better solution than using custom js.
we have three buttons on on modal dailog save,submit and cancel and some required fields . on click of submit button required fields valdation are not thrown and our activity is called and pop up getting closed we have tried save/update/close actions onClick noting is working so i am writing an pragraph rule for this
Posted: 5 years ago
Posted: 26 Nov 2016 23:45 EST
Santanu Bhattacherjee (Santanu)
Senior Manager, Cloud Engineering, Management Plane Services
Should I assume that you dont have any close icon on the modal and that is the reason you want to close it based on condition ?
Otherise, modal is smart enough to close itself on click of either OK or CANCEL .
I would recommend you to revisit your business requirement to see whether that can be achived via this OK or CANCEL button or not?
Otherwise, try using JS which will enamulate a click on SUBMIT.
For example, lets say I have a button on my screen post doing some operation I want to automatically click the submit ( without user intervention ) .so in that case, use code like this
<button type="button" value="submit" onClick="document.getElementById("element name ").click()">submit </button>