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



Apr 1, 2015, 9:01 PM
14 Posts

REST Service output into a variable?

  • Category: Extension Library
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: REST JSON
  • Replies: 1

I have a simple REST Service on my XPage. If I go to my xpage.xsp/pathInfo, it outputs the JSON data beautifully on my screen. I would like to take this JSON output and put it into a viewScope variable on my xpage.xsp. I am sure it's simple but I am not able to figure it out. 

Apr 2, 2015, 6:19 PM
586 Posts
hmmm

I assume you are not coding this yourself.. it's one of the built in Rest services?  It's not custom....


I would THINK you would need to use Dojo to call that...  maybe in onClientLoad...  or in a button... but the CSJS dojo would call it and get the JSON data...  then put into a local Javascript variable...  then you do an XSP.PartialRefreshPost..  or better yet a RPC call from CSJS to get the data into the viewScope...

Though when you type it out that seems a little on the silly side unless theres a reason...  would it not be better to just create the JSON in SSJS or Java and then do whatever with it?  In SSJS there are functions like toJson() that are available...

Just some thoughts...

Good Luck

 

 


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