GlideModal - processing script not executed

alexisbreuse
Kilo Explorer

Hi community,

 

I am in a scoped application.

When I click on my UI Action, I have a popup which displays a UI Page which displays a Reference field : 

find_real_file.png

 

But when I select something and clicks 'OK', the 'processing script' of the UI Page is not executed.

The important thing is that I use a GlideModal. 

Note that the processing script executes if I use a GlideDialogWindow or a GlideModalForm....

 

 

See my UI Page code below :

 

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">
	<style type="text/css">
		div {
			margin: 5px 20px 5px 20px;
		}
		.buttons {
			margin-top: 15px;
			text-align: right;
		}
	</style>
	
	<g:ui_form>
		<div>
			<g:ui_reference name="businessSector" id="businessSector" table="x_desgr_gcourr_secteurs_d_affaires"/> 
		</div>
		<div class="buttons">
			<g:dialog_buttons_ok_cancel ok="return onSubmit();" cancel="return onCancel();"/>
		</div>
	</g:ui_form>
</j:jelly>

 

Client script

function onCancel() {
	GlideModal.get().destroy();
	return false;
}

function onSubmit() {
	var businessSectorSelected = gel("businessSector").value;
	GlideModal.get().destroy();
	return true;
}

 

 

Processing script

gs.info('processing script');

 

 

Do you know why it doesn't execute ?

Do you have a work-around ?

 

Alexis

5 REPLIES 5

alexisbreuse
Kilo Explorer

Anyone has encounter this problem ?

alexisbreuse
Kilo Explorer

Is this fixed in London ?

jaloftas
Giga Contributor

It's because you are destroying your GlideModal before you are returning true. You don't need to do this if you are using the processing script, you just need to use the response.sendRedirect([URL]) to put the user where you want them to be after they've submitted your page, the GlideModal will automatically be destroyed. Alternatively you could use a GlideAjax call in your client script to call the server side processing.

Inactive_Use713
Kilo Contributor

Can you refer the below link
https://community.servicenow.com/community?id=community_question&sys_id=904e4111db539380b2102926ca961922