Solved

Xpages Popup Window

Posted on 2010-08-18
5
3,978 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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