How close UI Page Dailogue window?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 02:48 AM
Hi,
UI Page not working in Agent Workspace. how to close dialogue window in Agent workspace
UI Page 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">
<table width="100%" height="100%">
<tr>
<td>
<g:ui_multiline_input_field name="dial_comments" label="Additional comments" value="${jvar_comments_text}" mandatory="true" />
<label style="display: block;">Contact Type</label>
<g:ui_choicelist name='HoldReason' label="Contact Type" table='incident' field='contact_type'/>
<label style="display: block;">Business Service</label>
<g:ui_reference name="input_business_service" table="cmdb_ci_service" query="nameNOT LIKEBlackberry" label="Business service"/>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr id="dialog_buttons">
<td colspan="5" align="right">
<g:dialog_buttons_ok_cancel ok="return validateComments()" ok_type="button" cancel_type="button" />
</td>
</tr>
</table>
</j:jelly>
client script:
function validateComments() {
var businessservice=gel("input_business_service").value;
var comments = gel("dial_comments").value;
var contacttype=gel("HoldReason").value;
comments = trim(comments);
if ((comments == "" )||(businessservice=="")||(contacttype==""))
{
alert("Please Fill fields to submit the dialog.");
return false;
}
GlideDialogWindow.get().destroy();
g_form.setValue("comments", comments);
g_form.setValue('business_service',businessservice);
g_form.setValue('contact_type',contacttype);
}
how to fix OK, Cancel buttons issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2020 06:03 PM
Comment out the following script:
<tr id="dialog_buttons">
<td colspan="5" align="right">
<g:dialog_buttons_ok_cancel ok="return validateComments()" ok_type="button" cancel_type="button" />
</td>
</tr>
Now comment out the whole client script:
function validateComments() {
var businessservice=gel("input_business_service").value;
var comments = gel("dial_comments").value;
var contacttype=gel("HoldReason").value;
comments = trim(comments);
if ((comments == "" )||(businessservice=="")||(contacttype==""))
{
alert("Please Fill fields to submit the dialog.");
return false;
}
GlideDialogWindow.get().destroy();
g_form.setValue("comments", comments);
g_form.setValue('business_service',businessservice);
g_form.setValue('contact_type',contacttype);
}
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2020 10:24 AM
Hi Harsha,
Thanks for reply, i tried with below script. still window not going destroyed.
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">
<div class="container">
<div class="row">
</div>
<div class="row">
<form>
<g:ui_multiline_input_field name="dial_comments" label="Additional comments" value="${jvar_comments_text}" mandatory="true" />
<label style="display: block;">Contact Type</label>
<g:ui_choicelist name='HoldReason' label="Contact Type" table='incident' field='contact_type'/>
<label style="display: block;">Business Service</label>
<g:ui_reference name="input_business_service" table="cmdb_ci_service" query="nameNOT LIKEBlackberry" label="Business service"/>
<g:dialog_buttons_ok_cancel ok="return validateComments()" cancel="return cancel()" ok_type="button" cancel_type="button" />
</form>
</div>
</div>
</j:jelly>
Client :
function validateComments() {
var businessservice=gel("input_business_service").value;
var comments = gel("dial_comments").value;
var contacttype=gel("HoldReason").value;
comments = trim(comments);
if ((comments == "" )||(businessservice=="")||(contacttype=="")){
alert('test');
return false;
}
GlideDialogWindow.get().destroy();
g_form.setValue("comments", comments);
g_form.setValue('business_service',businessservice);
g_form.setValue('contact_type',contacttype);
return true;
}
function cancel()
{
g_modal.showFrame(false);
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2020 07:42 AM
do you have any solution for it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2020 08:42 AM
Hi,
Please try this to close the dialog box
GlideDialogWindow.get().destroy(); //Close the dialog window
Client :
function validateComments() {
var businessservice=gel("input_business_service").value;
var comments = gel("dial_comments").value;
var contacttype=gel("HoldReason").value;
comments = trim(comments);
if ((comments == "" )||(businessservice=="")||(contacttype=="")){
alert('test');
return false;
}
GlideDialogWindow.get().destroy();
g_form.setValue("comments", comments);
g_form.setValue('business_service',businessservice);
g_form.setValue('contact_type',contacttype);
return true;
}
function cancel()
{
g_modal.showFrame(false);
return false;
}
Please mark correct or helpful.
Thanks
Swapnil Soni