How can I replace GlideDialogWindow.get().destroy(); in the Client Script for a UI Page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2024 01:58 PM
I have been building a UI Page to capture simple comments as Notes, and When checking examples for the Ok and Cancel button, I am using something like this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2024 10:54 PM
You can try something like below for OK and Cancel scenario:
var dialog = new GlideModal('glide_modal_confirm', true, 400);
dialog.setTitle(new GwtMessage().getMessage('Title'));
dialog.setPreference('body', new GwtMessage().getMessage("Do you want to continue?"));
dialog.setPreference('buttonLabelComplete', new GwtMessage().getMessage('Yes'));
dialog.setPreference('buttonLabelCancel', new GwtMessage().getMessage('Cancel'));
dialog.setPreference('onPromptComplete', onConfirm); //call function
dialog.setPreference('onPromptCancel', onCancel); //call function
dialog.render();
function onConfirm() {
saveAndClose = true;
}
function onCancel() {
saveAndClose = false;
}
(=tested)
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 07:39 AM
It is unclear to me where this script should be used, since with the GlideDialogWindow.get().destroy(); I will use it on the UI Page Client Script and assign functions to the buttons including the GlideDialogWindow.get().destroy();, I tried to set up your script in many ways and could not make the buttons work.