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



Mar 10, 2011, 5:28 PM
64 Posts

Re: remove url parameter from the address

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: url parameter
  • Replies: 6
- The only way I know to do this is to compute the new URL and reload the page completely using context.redirecToPage().  Then the address bar in the browser will reflect what's actually in force.  XPage actions on the same page, even full refreshes, tend not to update the URL for any reason, making it essentially impossible for a bookmarks to work correctly out of the box.
 
Hope this helps...
Mar 12, 2011, 12:20 PM
8 Posts
Re: remove url parameter from the address
In the end I used context.redirectToPage(). This performs the search and leaves the URL clear of any parameters. The disadvantage is that the initial search is not bookmarkable. One could probably get around that by coding the redirect to occur on the next click of the search button rather than immediately. But in my particular case that would mean adding some transfer of many requestScope variables to sessionScope ones and the back on the load of the page, which I did not do. 
 
This is the code I used. 

if((context.getUrlParameter("par1")!="")) {

sessionScope.put("par1",parseFloat(context.getUrlParameter("par1")));

sessionScope.put("renderResults", true);

sessionScope.put("urlRedirect", true);

context.redirectToPage("XPage.xsp",true);

} else {

if(sessionScope.urlRedirect) {

requestScope.par1e=sessionScope.par1;

requestScope.renderResults=sessionScope.renderResults;

sessionScope.remove("par1");

sessionScope.remove("renderResults");

sessionScope.remove("urlRedirect");

}

}

 

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