Confirmation Dialog Box using UI Page, OK Button will not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2019 11:06 AM
When cancelling a change, I am using a confirmation dialog box that pops up to enter reason and select OK. When I enter the reason, select OK, nothing happens. I xml'd the ui page and the Cancel change ui action from my personnel development instance because it works there. I must be forgetting another piece like a client script or something? Below is the information. I just need to get the OK button to do something when I click it.
UI Page: Change_confirm_cancel
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="change_confirm_cancel"
textarea_id="change_confirm_reason_text"
textarea_label="${gs.getMessage('Reason')}"
textarea_label_title="${gs.getMessage('A reason is required to cancel this change')}"
textarea_name="change_confirm_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="cancelChangeRequest"
ok_id="change_confirm_ok_btn"
ok_title="${gs.getMessage('Cancel change request')}"
ok_type="button"
ok_style_class="btn btn-primary disabled"
cancel_title="${gs.getMessage('Close the dialog')}"
/>
</j:jelly>
UI Page Client script:
function cancelChangeRequest() {
var textArea = $("change_confirm_reason_text");
if (textArea)
moveToCancel(textArea.value.trim());
}
(function() {
$("change_confirm_reason_text").focus();
})();
Cancel Change UI Action:
UI Action Script:
var changeConfirmCancelDialog;
function loadConfirmDialog() {
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
changeConfirmCancelDialog = new dialogClass("change_confirm_cancel", false, 648, 250);
changeConfirmCancelDialog.setTitle(new GwtMessage().getMessage("Cancel Change Request"));
changeConfirmCancelDialog.render();
}
function moveToCancel(notes) {
var ga = new GlideAjax("ChangeRequestStateHandlerAjax");
ga.addParam("sysparm_name", "getStateValue");
ga.addParam("sysparm_state_name", "canceled");
ga.getXMLAnswer(function(stateValue) {
g_form.setValue("state", stateValue);
g_form.setValue("work_notes", notes);
changeConfirmCancelDialog.destroy();
gsftSubmit(null, g_form.getFormElement(), "state_model_move_to_canceled");
});
}
if (typeof window == 'undefined')
setRedirect();
function setRedirect() {
current.update();
action.setRedirectURL(current);
}
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2019 12:27 PM
Your code looks fine. When the dialog box first opens, i assume the OK button is greyed out. Then you enter comments, and nothing happens?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2019 12:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 07:15 PM
Did you ever figure this out? I'm having a similar issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 04:06 AM