Link to home
Start Free TrialLog in
Avatar of Bristan_Service_Desk
Bristan_Service_DeskFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Xpages Popup Window

Hi all

I've recently started to play with Xpages within Notes 8.5 and have knocked up a little xpage that shows call awaiting allocation within our service desk system with a link to open the call.  The link opens the standard web enabled form, not an Xpage using the following code set in the data\pageUrl section of All Properties within the view panel column:

var _row:NotesXspViewEntry = rowData;
var _unid = _row.getUniversalID();
return "http://server/database.nsf/0/" + _unid + "?OpenDocument";

My question is this, how can I get the document to open in a 'new' window so that the user does not navigate away from the Xpage?  I'm guessing the javascript will need to be client side but the only option for the above is server side...
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Yes, the calculation is server side, but there are more tricks. Two solutions (at least):
- javascript window.open()
- a link with a target

In both cases you have to generate HTML code. The first method is blocked nowadays by many browsers, plus it's a little more complex, so here's the idea how to handle the second one.

Create a view column of content type HTML, with the following formula:

base:=@Subset(@DbName; -1);
html:=html + "<a href=\"/" + base + "/0/" + _unid + "?OpenDocument\" target=\"_blank\">";
html:=html + subject;
html:=html + "</a>";
html

Or similar in SSJS.
Oh, and there is a third way: create an Iframe on the fly.
ASKER CERTIFIED SOLUTION
Avatar of Jan Maritz
Jan Maritz
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bristan_Service_Desk

ASKER

That's just what I was looking for.......however, just to be a pain, is it possible to pop the window in a new 'tab' instead of a window?
It is down to the browser and settings afaik, e.g. for IE the tabbed browsing settings - http://helpdeskgeek.com/how-to/force-ie-to-open-link-in-new-tab/ . You can only direct into a new window (_blank) or the same window etc.

Steve