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



Jul 5, 2012, 5:56 PM
50 Posts
topic has been resolvedResolved

Open xpage in new tab using xp:button

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: button
  • Replies: 1
I have an XPage with a button control (xp:button value="Open Form" dojoType="dojox.form.BusyButton"). I'm using the onClick event to open an XPage form (xp:openPage name="/Form.xsp" target ="newDocument"). I would like for that action to open Form.xsp in a new tab. Nowhere on the button control do I find a way to mimic target="_blank".
 
Does anyone know how I can do this using a Button control in XPages? I know I could accomplish this with a Link control, but I would prefer to keep the Button as it fits my design better.
 
Thanks.
Jul 13, 2012, 7:52 PM
13 Posts
Re: Open xpage in new tab using xp:button
I think this might be what you're looking for:
 

<xp:button value="Click here to open Google in a new window" id="button1">

<xp:eventHandler event="onclick"

submit="true" refreshMode="norefresh">

<xp:this.script><![CDATA[window.open("http://www.google.com", "_blank");]]></xp:this.script>

</xp:eventHandler>

</xp:button>

 
Of course, you'll need to change the CSJS (or you could do it with SSJS) to open your xpage vs. url.
 
Hope this helps! 

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