- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 09:29 PM
Hi there,
I created a UI page that displays Yes/No button. Based on the user input selection the actions gonna take place. But the user is still able to close the UI page using the "cross mark" without selecting any input. That should not happen.
Please help me in removing that "cross mark" and also I want to place this UI popup at the top of page instead of center.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 10:09 PM
Hi,
You can use this code and it would show the confirm box with Yes/No and it comes in center
var dialog = new GlideModal('glide_modal_confirm', true, 300);
dialog.setTitle('Confirmation');
dialog.setPreference('body', 'Is there a Cost impact?');
dialog.setPreference('focusTrap', true);
dialog.setPreference('onPromptComplete', doComplete);
dialog.setPreference('onPromptCancel', doCancel);
dialog.render();
function doComplete() {
callback(true);
}
function doCancel() {
callback(false);
}
Output:
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 09:40 PM
Hi Harish,
use the below code to remove it.
dialog.removeCloseDecoration();
replace the dialog with your dialog window object.
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 09:49 PM
Hi Sandeep,
Thanks it worked. Can you please help me in placing the popup at the top instead of center?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 09:57 PM
Hi,
I would request you to discuss with your customer whether it should be actually removed or not.
I doubt you can add on center or not
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 10:04 PM
Hi Ankur,
Yes, I brought this to the customer they don't want to see the cross mark and they need the popup to be shown at the top like how an alert/confirm message displays at the top.
I thought of using the confirm message but with the confirm message we can't show Yes/No we can show ok/Cancel buttons.