- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2015 04:18 AM
Hi SNC,
A little tweak here - I have created a UI action which I want to open a URL. As I have it built right now, it opens in a separaate tab of the browser, which is OK, but it would be much nicer if it could open in a popup window in the same browser tab. If anyone has done that, would appreciate if you share it with me.
Here is the script for my UI action:
function show_change_windows() {
var id = $F('sys_uniqueValue');
var url = new GlideURL('https://myinstance.service-now.com/change_windows.gifx');
url.addParam('sysparm_stack', 'no');
url.addParam('sysparm_table', g_form.getTableName());
url.addParam('sysparm_document', id);
var w = getTopWindow();
w.popupOpenFocus(url.getURL(), 'show_change_windows', 950, 700, '', false, false);
}
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2015 07:40 AM
window.open(url, windowName, "height=200,width=200");
When you specify a width/height, it opens it in a new window instead of a tab.
Cheers,
Roberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2015 07:03 AM
Cant you have a UI page with a iframe and have the iframe display the URL ? That should do the job . Isn't it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2015 07:40 AM
window.open(url, windowName, "height=200,width=200");
When you specify a width/height, it opens it in a new window instead of a tab.
Cheers,
Roberto

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2015 07:45 AM
I did overthink this
That was simple and works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2015 02:59 AM
Roberto Alvarez Alonso - nice dude, I can't believe it was that easy, really saved me a lot of hustle:)
By the way, one small additional question (not trying to be picky:)) - currently the new window opens top left side of the screen. Do you know how to make it appear in the center of the screen? Otherwise - thanks again!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2015 03:11 AM