FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Dec 11, 2011, 7:37 AM
170 Posts

Get current viewid in SSJS

  • Category: Server Side JavaScript
  • Platform: Not Applicable
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 3
 Each page that is connected to a datasource gets a viewid. It's displayed in the hidden field $$viewid on each xpage.
Can this be retrieved in SSJS? 
 
/Fredrik 
 
http://www.xpagedeveloper.com 
 
 
Dec 11, 2011, 4:21 PM
272 Posts
Re: Get current viewid in SSJS
Hi Fredrik,
 
try this (gets the $$viewid of the current view)
 
var id = com.ibm.xsp.application.UniqueViewIdManager.getUniqueViewId(facesContext.getViewRoot());
 
or this (gets the value of the $$viewid field of the request)
 
var requestid = facesContext.getExternalContext().getRequestParameterMap().get("$$viewid") 
 
Sven
 
Dec 12, 2011, 12:05 PM
170 Posts
Re: Get current viewid in SSJS
 Where do you find all this deep down information ?

FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.