SreeSindhuSruth
Enthusiast
Enthusiast

Error in webclient 6.5 - (fling sdk) setGlobalRefreshHandler is not a function

Jump to solution

Hi,

using fling sdk and with the angular component file have the code 

this.gs.getWebPlatform().setGlobalRefreshHandler(this.refresh.bind(this), document);

When registred with VCSA 6.5 html client it says TypeError: this.gs.getWebPlatform(...).setGlobalRefreshHandler is not a function pointing to mainbundle.js

Browser - chrome and firefox.

Please help me on how to fix this. As per the documentation callback function needs to be passed as parameter so refresh is the callback function here.

0 Kudos
1 Solution

Accepted Solutions
laurentsd
VMware Employee
VMware Employee

in global.service.ts, in the constructor for Globals, use this to patch webPlatform in case setGlobalRefreshHandler is not defined (replace the current code)

          if (!this.webPlatform.setGlobalRefreshHandler) {

          this.webPlatform.setGlobalRefreshHandler = function (handler) {

              window.parent["WEB_PLATFORM"]["refresh" + window.name] = handler;

          };

     }

View solution in original post

0 Kudos
3 Replies
ilyak
Contributor
Contributor
make sure that you are using the latest version of the sdk 
0 Kudos
laurentsd
VMware Employee
VMware Employee

in global.service.ts, in the constructor for Globals, use this to patch webPlatform in case setGlobalRefreshHandler is not defined (replace the current code)

          if (!this.webPlatform.setGlobalRefreshHandler) {

          this.webPlatform.setGlobalRefreshHandler = function (handler) {

              window.parent["WEB_PLATFORM"]["refresh" + window.name] = handler;

          };

     }

View solution in original post

0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast

Thanks.It worked.

0 Kudos