This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Nov 21, 2011, 10:57 AM
51 Posts
topic has been resolvedResolved

open calculated link in new page

  • Category: Other
  • Platform: Windows
  • Release: 8.5.1
  • Role: Developer
  • Tags:
  • Replies: 7
 I'm using a calculated link in a view like :
 "https://server/example.nsf/O/"+thisid+"/%24FILE/"+thisdocument;
How can this link automatically be opened in a new page (tab) ? 
 
Nov 21, 2011, 12:11 PM
261 Posts
Re: open calculated link in new page
How are you creating the links? Using a <xp:link> control?
 
If so, you can simply add the target="_blank" attribute.
 
Mark
Nov 21, 2011, 2:13 PM
51 Posts
Re: open calculated link in new page
 No I' m using : <xp:this.pageUrl> and returning the link
Nov 21, 2011, 5:50 PM
53 Posts
Re: open calculated link in new page
If you go to the onclick event in all properties of the link you can add
 
window.open(href, "_blank");
return false;
 
Edit - sorry, ignore that, didn't read your second post properly this applies to links still
 
Second edit - actually, you may be able to use this on the onclick event still (don't normally use views so had to check)
Nov 22, 2011, 8:19 AM
51 Posts
Re: open calculated link in new page
 Still can't get this to work.
 
In the all properties of the View Column I have : 
displayAs : link 
PageUrl : the calculated link 
 
when I add "_blank" to the calculated link under PageUrl , it doesn't work. 
When I calculate the link under the onclick event it doesn't work ... 
 
Probably I'm misunderstang something .. 
Nov 23, 2011, 9:40 AM
261 Posts
Re: open calculated link in new page
Marc,
 
You can't set the target on a default viewPanel column.
 
What you need to do:
 
  • add a var attribute to your xp:viewPanel control so you can reference an entry in a view column:
<xp:viewPanel rows="30" id="viewPanel1" var="entry">
  • add a <xp:link> control to the link column:

<xp:viewColumn id="viewColumn7">
            <xp:this.facets>
                <xp:viewColumnHeader xp:key="header" id="viewColumnHeader7" value="link to document"></xp:viewColumnHeader>
            </xp:this.facets>

            <xp:link escape="true" id="link1" target="_blank">
                <xp:this.text><![CDATA[#{javascript:entry.getColumnValue("nameOfTheColumnContainingTheTextForTheLink")}]]></xp:this.text>
            <xp:this.value><![CDATA[#{javascript:entry.getOpenPageURL(null, true)}]]></xp:this.value></xp:link>

</xp:viewColumn>

(the second parameter of the getOpenPageURL defines if you want to open the page in read or edit mode)
 
Mark
Nov 23, 2011, 12:25 PM
51 Posts
Re: open calculated link in new page
 Mark,
Thank you , this way I can open a page in a new tab , 
but .... 
since the link is to open a pdf file in a notes document from another database , it doesn't seem to work. 
Replacing the null in the getOpenPageURL with the correct url doesn't seem to work because some code is added after this url automatically ... 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal