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



Oct 15, 2012, 11:10 PM
5 Posts

access and store $$previouspage as a variable

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: previouspage launchpage cancel viewpanel
  • Replies: 0
Hi,

I have a standard xpages viewpanel with the usual pager, an ability for the user to select how many results to display per page, and an ability for the user to open or close all twisties (categorized view) at once.

This combination of viewpanel options can lead to a very complicated viewpanel state. For example, the user may close all twisties, then go to page two, then open one twistie, then go to page 5 and open another twistie, and then click a document under this twistie.

If the user clicks this document (to open its xpage), and then presses the document's cancel button the simple action works miraculously to return the user to where they were in that complicated configuration of twisties and pages.

<xp:this.action>
<xp:openPage name="$$PreviousPage"></xp:openPage>
</xp:this.action>

Here is my problem: In some instances, I must refresh the document xpage. This resets $$PreviousPage to the current document xpage, not the xpage with the viewpanel, so if the user selects Cancel, the simple action is no longer returning the user to that view as expected.

Before I refresh the document xpage, I would like to store the $$PreviousPage value so that I can retrieve it if the user selects Cancel. I was hoping for something like

sessionScope.put("previousPage", $$PreviousPage)

I am aware that there are other ways to store the state of a viewpanel without relying on $$PreviousPage. For instance,

var c = getComponent("viewPanel");
if (c) {
    sessionScope.put("viewfirst"+view.getPageName(), c.first);
}


but just saving the page, does not take into account the state of the twisties, so it can lead to unexpected (i.e., wrong) results.

So what is $$PreviousPage? Does it belong to the database? The context? Is it an environment variable of some kind? How does one access its value via javascript and tap into its amazing ability to put my users right back where they want to be?

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