Solved

Xpages Popup Window

Posted on 2010-08-18
5
3,939 Views
Last Modified: 2013-12-18
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...
0
Comment
Question by:Bristan_Service_Desk
5 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 33472625
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.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 33494176
Oh, and there is a third way: create an Iframe on the fly.
0
 
LVL 2

Accepted Solution

by:
jmaritz earned 500 total points
ID: 33541871
Ok it works like this.
same as you just a small change to work in any database:
var _row:NotesXspViewEntry = rowData;
var _unid = _row.getUniversalID();
return  "0/" + _unid + "?OpenDocument";

then in the events\onClick enter the following code.
window.open(href,"_blank");
return false;

make sure it is Client Side Script

Opens a new window with your document in and leave the view as is.


event-onclick.JPG
0
 

Author Comment

by:Bristan_Service_Desk
ID: 33611164
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?
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 33614002
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
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now