Custom UI Page Pop up is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 10:46 PM
Hi @Ankur Bawiskar
Need help below code is not working as expected
UI page script
Html:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:dialog_notes_ok_cancel
dialog_id="flag_reason"
textarea_id="flag_reason_text"
textarea_label="${gs.getMessage('Reason')}"
textarea_label_title="${gs.getMessage('A reason is required to cancel this flag')}"
textarea_name="flag_reason_text"
textarea_onkeyup="enableButton()"
textarea_onchange="enableButton()"
textarea_style="height:auto; width: 100%; resize: vertical;"
textarea_title="${gs.getMessage('Enter the reason here')}"
ok=""
ok_action="cancelflag"
ok_id="change_confirm_ok_btn"
ok_title="${gs.getMessage('Cancel flag')}"
ok_type="button"
ok_style_class="btn btn-primary disabled"
cancel_title="${gs.getMessage('Close the dialog')}"
/>
</j:jelly>
Client script :
function cancelflag() {
var textArea = $("flag_reason_text");
if (textArea)
moveToCancel(textArea.value.trim());
}
(function() {
$("flag_reason_text").focus();
})();
UI action script:
onclick : loadConfirmDialog();
var flagreason;
function loadConfirmDialog() {
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
flagreason = new dialogClass("flag_reason", false, 648, 250);
flagreason.setTitle(new GwtMessage().getMessage("Cancel flag"));
flagreason.render();
}
function moveToCancel(notes) {
g_form.setValue("comments", notes);
flagreason.destroy();
gsftSubmit(null, g_form.getFormElement(), "u_flag");
}
if (typeof window == 'undefined')
setRedirect();
function setRedirect() {
current.update();
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 10:51 PM
so what's not working?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 10:53 PM - edited 01-11-2024 10:55 PM
Dialog window is not appearing. When i click on Ui action nothing is happening . i missed something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 11:22 PM
are you calling ui page correctly?
you are in global scope or custom scope?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 11:58 PM - edited 01-12-2024 12:01 AM
Global scope
Yes i have given correct name . I am trying in PDI
On service offering table i am trying