UI page render via GlideModal goes to a blank white screen!

Daniel Gleason
Giga Expert

Hi,

 

I am trying to open a UI page with GlideModal with the following code from a UI action in the global scope.

client: checked

onClick field: open();

function open(){
var gm = new GlideModal('ui_page');
gm.setTitle('Show title');
gm.setWidth(550);
gm.render(); 
	
}

 

However I just get a blank screen. Here is the UI page I am testing with:

name: ui_page 

scope: Global

HTML / Jelly:

<?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:ui_form>
	<table>
		<tr>
		<td style="width:25%">
			<g:form_label>
			Name: 
			</g:form_label>
                 </td>
		<td style="width:60%"> 
                 <input type="text" aria-label="Print your name" name="my_name" id="my_name" maxlength="25"/>	
                </td>
		</tr>
		<tr>
                  <td style="width:25%">
			<g:form_label>
			Select User: 
		        </g:form_label>		
                  </td>
		  <td style="width:60%">
		    <g:ui_reference name="user_ref" id="user_ref" query="user_nameSTARTSWITHa" table="sys_user"  />
                   </td>
                </tr>
		<tr>
                   <td style="width:25%">
			<g:form_label>
			Select Incident: 
			</g:form_label>
                   </td>
		    <td style="width:60%">
                      <g:ui_choicelist name="my_category" id="my_category" table="incident" mandatory="true"   field="category" query="active=true"/>
                    </td>
                </tr>
		<tr>
                     <td>
                       <g:dialog_buttons_ok_cancel ok_id="submitData" ok="return continueOK()" ok_type="button" ok_text="${gs.getMessage('Okay')}" ok_style_class="btn btn-primary" cancel_type="button" cancel_id="cancelData" cancel_style_class="btn btn-default" cancel="return continueCancel()"/>
                    </td>
               </tr>
	</table>
	</g:ui_form>
</j:jelly>

 

Client Script:'

function continueOK() {
	alert("OK clicked");
	var gdw = GlideDialogWindow.get();
	var name =gel('my_name').value;
	var user = gel('user_ref').value;
	var cat = gel('my_category').value;
        var sys_id = gdw.getPreference('sys_id'); //get the values passed in the client script 
	var selected_value = gdw.getPreference('value'); //get the values passed in the client script 
	alert(name+"---"+user+"---"+cat+"---"+sys_id+"---"+selected_value);
	GlideDialogWindow.get().destroy();
}
function continueCancel() {
	alert("Cancel clicked");
	GlideDialogWindow.get().destroy();
}

 

Processing Script:

var user = request.getParameter("user_ref"); //mention the name of the elment here
var my_name = request.getParameter("my_name"); //mention the name of the elment here
var category = request.getParameter("my_category"); //mention the name of the elment here
gs.info("Asif: testing "+user+"---"+my_name+"---"+category);

 

Any suggestions? Would be much appreciated, as I've been trying to debug this for hours. 

 

Thanks,

Dan

5 REPLIES 5

Hi,

what happens when you try using this?

var gm = new GlideDialogWindow('clone_cancel_popup');

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader