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.

Can't seem to resize my popup dialog window

solymyr
Kilo Expert

Hi,

I am trying to achief a popup dialog window. I am almost were I want to be with my development. Except on the size of my popup.

Initially the size and the way my popup is being displayed is fine.

It is when I "unlock" my reference field that it isn't any more.

Popup before I click the lock:

Before.PNG

Popup after I click the lock:

After.PNG

As you can notice I don't have a nice screen anymore.

I have no idea how to fix this so that I have good with and height.

Or maybe an auto resize when I click the lock.

1 ACCEPTED SOLUTION

Hi,



Just in case you all wondered how this ended...


I have found a solution without a ui page.


I continued working on the UI Action but instead of using using "GlideDialogWindow" , I have used "GlidePaneForm".


I use the method to call a view and displays it in a larger window then a popup.


The result is a good lay-out


Capture.PNG




Thank you for you help Daryll and Ashish


View solution in original post

12 REPLIES 12

solymyr
Kilo Expert

I wanted to add the way I created this popup.


It is an UI action script.


You might notice some commented lines of code where I   attempt to reach my goal.


So far no success...



function showMyForm(){
      //Get the table name and sys_id of the record
      var tableName = 'u_coha';
      var sysID = g_form.getUniqueValue();


//Create and open the dialog form

      var dialog = new GlideDialogForm('Send Coha Attachment', tableName); //Provide dialog title and table name
      //popupOpenFocus(url, 'Send Coha Attachment', 950, 700, '', false, false);  
dialog.setSysID(sysID); //Pass in sys_id to edit existing record, -1 to create new record
      dialog.addParm('sysparm_view', 'popup'); //Specify a form view
      dialog.addParm('sysparm_form_only', 'true'); //Add or remove related lists

//dialog.setWidth(100);
//dialog.setHeight(750);
//dialog.setSize(350,2000);

dialog.setLoadCallback(function(iframeDoc) {
      // To get the iframe: document.defaultView in non-IE, document.parentWindow in IE
      var dialogFrame = 'defaultView' in iframeDoc ? iframeDoc.defaultView : iframeDoc.parentWindow;
          //dialogFrame.g_form.getControl('u_send_to_unlock').click();
// dialogFrame.g_form.getControl('u_message').style.width = '500px'
dialogFrame = null;
      });


      dialog.render(); //Open the dialog
}


I've done this before and it works fine.


Here is my script to resize the dialog window...


var dialog = new GlideDialogWindow('terms_acceptance_dialog');


      dialog.setTitle("Please be aware..."); //Set the dialog title


      dialog.setSize(900,800); //Set the dialog size


      dialog.removeCloseDecoration(); //Remove the dialog close icon


      dialog.render(); //Open the dialog


Hi Daryll,



I have tried the setSize(width,height) option.


But it still isn't right:


Before lock:


Before.PNG



After lock:


After.PNG


The last screen shot you posted looks like it has got wider. Maybe you just need to adjust your width to be a bit wider