VMware {code} Community
SreeSindhuSruth
Enthusiast
Enthusiast
Jump to solution

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

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
laurentsd
VMware Employee
VMware Employee
Jump to solution

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

Reply
0 Kudos
3 Replies
ilyak
Contributor
Contributor
Jump to solution

make sure that you are using the latest version of the sdk 
Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

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;

          };

     }

Reply
0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast
Jump to solution

Thanks.It worked.

Reply
0 Kudos