VMware {code} Community
ChrisSmith2
Enthusiast
Enthusiast

Global refresh handler not called after action in 6.5U1 (regression from 6.5.0d/5097204)

On 6.5.0d VCenter Server / VCSA installs and when using the 5097204 Fling "vsphere-ui", performing an Action would cause the global refresh handler to be called when the action completed. However, on 6.5U1 (or using the 6.5U1 SDK "vsphere-ui"), the global refresh handler is no longer called when an action completes. Instead, a manual click of the "Refresh" button in the top toolbar is required to bring the current view up to date.

This issue occurs using the same plugin binaries; both plugins built using the older "web-platform.js" and those built using the new bootstrapping mechanism suffer the same issue. I've attached a build of the "chassis-b" sample using 6.5U1 to demonstrate the issue - the only change is to add a Javascript alert to the refreshData() function, so that it is clear whether it is called. Repro steps are to drop it into the "pickup" directory of the "vsphere-ui" server config, go to GIL/ChassisB, select a chassis, see the initial refreshData popup, click "Actions > Edit Chassis > Update Chassis" - on 6.5.0d/5097204 the refreshData popup appears, on 6.5U1 (SDK or full install) it doesn't.

This is a serious usability regression - there were issues with the refresh behaviour in 6.5.0 RTM, but the user experience on 6.5.0d was excellent, with immediate feedback on the results of actions.

Is this a known issue? Is it an intentional regression (and if so why), or will it be fixed in a future update? Is there any workaround possible?

8 Replies
Denis_Chorbadzh
VMware Employee
VMware Employee

Hi Chris,

Yes, this is a known issue. In fact, there were serious performance considerations for automatically calling the Global Refresh after each plugin change event and we have decided to remove it for the time being.

We are working on providing a better way for plugins to refresh their data but, for now, the workaround is to call the Global Refresh manually.

 

Regards,

Denis

0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast

Denis_Chorbadzhiyski

Can you please let me know does adding the following code in js file/angular component works.

WEB_PLATFORM.setGlobalRefreshHandler;

0 Kudos
Denis_Chorbadzh
VMware Employee
VMware Employee

Yes, the API setGlobalRefreshHandler() works. It can be seen in our chassisA/chassisB SDK samples.
0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast

ngOnInit(){

     this.refreshData();

     this.globals.getWebPlatform().setGlobalRefreshHandler(this.refreshData, document);

}

refreshData(){

     //business logic

}

          callsomeService();

}

The code doesn't work and manual refresh causes let side pane disappear.

vsphere web client - 6.5

0 Kudos
Denis_Chorbadzh
VMware Employee
VMware Employee

In 6.5GA the setGlobalRefreshHandler(handler) is defined in the "web-platform.js" in the plugin itself and takes one argument.

Can you test  your code using 6.5 Update 1 or the latest Fling and see if it works as expected?

0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast

ngOnInit(){ 

 

     this.refreshData(); 

     this.globals.getWebPlatform().setGlobalRefreshHandler(this.refreshData); 

 

refreshData(){ 

     //business logic 

          callsomeService(); 

Are you saying that this is how the code should be or there is no need of this.

In fling webplatform.js is not available.

In the gloabals.service.ts the below code has been added :

if (!this.webPlatform.setGlobalRefreshHandler) {

          this.webPlatform.setGlobalRefreshHandler = function (handler) {

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

          };

     }

Please let me know  which approach do I have to take.

Thanks!

0 Kudos
Denis_Chorbadzh
VMware Employee
VMware Employee

Hi,

"web-platform.js" does not exist because it is deprecated. We have introduced a new bootstrapping mechanism for JS APIs in 6.5 Update 1 and you no longer need to bundle "web-platform.js" with your plugin.

We have provided an example of using the new bootstrapping in the latest SDK samples. There you can find also the fallback logic if you are using 6.5GA.

Using the latest release, this code should be fine: 

ngOnInit(){           this.refreshData();        WEB_PLATFORM.setGlobalRefreshHandler(this.refreshData, document);   }      refreshData(){        //business logic   }             callsomeService();   } 
0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast

This code is not working with 6.5GA client.

Even the manual refresh doesn't load both the object navigator and workspace correctly.

window.parent is null is the error that it shows.