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



May 13, 2011, 12:25 PM
5 Posts

Open XPage via Javascript

  • Category: Extension Library
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: popupMenu,Open,XPage
  • Replies: 1
Hi,
 
I was asking yesterday about a dropdown button, and I have decided for a button / Popup menu combo.  Asthetically, this is exactly what I had in mind.  But I have a problem.
 
I want the onClick event of one of the options to take the user to another XPage in the same application.  I tried manually inserting the XML code for the simple action -- no success.  I got the error message that the leaf node can only  take tags of the <xp:this. -whatever-> format.  This means (as far as I am aware) that I am limited to "this.script".  This means that a simple action does not work.
 
I did a search for what js function I could call.   I found the option to open a URL, but I need to know the server name now, and I want to leave the application open to the possibility to be replicated and copied, and therefore do not want to have this hardcoded.  I tried using context.redirectToPage("xp_myXPage"); but then the page is redirected on load and not onClick  (the code is definately written in the onClick action=). 
 
Is anyone aware of a javascript function that I could call to open a relative link to the XPage using an onClick event?
 
Thanks, 
 
Greg 
May 13, 2011, 7:17 PM
35 Posts
Re: Open XPage via Javascript
try this:
 
return "/YourXpage.xsp"  

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