?
Solved

Xpages Popup Window

Posted on 2010-08-18
5
Medium Priority
?
4,064 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month11 days, 6 hours left to enroll

752 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