
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2015 11:26 PM
Hi Experts,
I have a requirement where I am calling a UI page to perform some action on the form. First the user opens the form, modify the data and click on the ui action, there I am calling a ui page which displays a pop up to perform some action. If user close the pop up without performing the action by clicking the (X) button(the X button will be there for pop up window), then the data on the form should be saved automatically without clicking on the ui action again. I am stuck how to find the control that user has clicked on X button to perform save operation.
Thanks in advance!
Regards,
Sunil Safare.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2015 11:45 PM
I had this in one of the UI pages that I had designed. This will call some function when the close icon of the popup window is clicked. Add it on your UI page.
document.getElementById('popup_close_image').onclick = function() {submitForm();};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2015 11:38 PM
Hi Sunil,
Try this
GlideDialogWindow.get().destroy();
Please check section 4.1 for more info.
http://wiki.servicenow.com/index.php?title=GlideDialogWindow_API_Reference#destroy.28.29

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2015 11:45 PM
I had this in one of the UI pages that I had designed. This will call some function when the close icon of the popup window is clicked. Add it on your UI page.
document.getElementById('popup_close_image').onclick = function() {submitForm();};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2015 12:05 AM
Thanks Pradeep
Thanks a lot Kalai. Worked Perfectly

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2015 12:17 AM
One more help Kalai.
I have written submitForm() function as below.
function submitForm(){
GlideDialogWindow.prototype.get('ui_page_name').destroy();
gsftSubmit(null, g_form.getFormElement(), 'ui_action_name');
}
The code is entering here but still UI page pop up is not getting disappeared.
Thanks and Regards,
Sunil Safare