Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI Page Dialog window Size

Surbhi Srivasta
Tera Expert

Hi,

I have created a UI Page where I am dynamically displaying the data in my UI Page.

So far I have been able to get the data displayed in my UI Page, but the problem which I am facing is regarding the size of the popup.

Based on content how can I make it auto fit to the content? Right now for some it is showing properly but for some it's going out of Browser window size.

 

My code below:

I am populating Description from Client script of my UI page to HTML based on help done by Ankur. Below is my code:

 

UI Page HTML:

<div>
		<b>Description</b>
		<br/>
		<br/>
		<pre><p id="description"></p></pre>
		
	</div>

 

UI Page Client Script:

populateDetails();

function populateDetails() {
    var getDetails = new GlideAjax('SI Name');
    getDetails.addParam('sysparm_name', 'Function Name');
    getDetails.addParam('sysparm_recordID', g_form.getUniqueValue());
    getDetails.addParam('sysparm_record_table', g_form.getTableName());
    getDetails.getXMLAnswer(getDetails);
}

function getDetails(answer) {
    var parseEmail = JSON.parse(answer);
    document.getElementById('description').innerHTML = parseEmail.body;
}

 

8 REPLIES 8

Hi @Ankur Bawiskar 

Also, do you have an idea on this problem? This is for UI Page issue only

https://www.servicenow.com/community/developer-forum/pass-value-from-client-script-to-processing-scr...

I have the same issue, did you manage the find any solution for the issue?

 

 

Pravindra1
Tera Guru

Hi @Surbhi Srivasta ,

Try below to open the UI page and set the size of window.

	var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
	var confirmDialog = new dialogClass("confirm_box", false, 648, 250); // UI Page name - "confirm_box" and Size of PopUp Window - 648/250
	confirmDialog.setTitle("Title of Page"); //Set Title of Page
	confirmDialog.render();

 

Hi @Pravindra1 

Did not worked at all. Even the popup did not come up.

 

Regards,

Surbhi