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 ?