VMware {code} Community
MichaelLee81
Contributor
Contributor

Storage Tab not getting refreshed

Hi,

We're developing a plugin using HTML-Bridge. We are using the chassis example provided by the sdk to get us started. We have a requirement where storages are based on the system that the user selects. We have this issue where in the objects tab is not getting refreshed.

It goes something like this:

1. Once the user click our icon(shortcut), it will direct them to our home view which shows collection of system in thumbnail form.

     Home.png

2. The user will then select or pick a system, say for example, the 'MLA'. Behind the scene, it is setting the connection/configuration to used and then retrieves all the storages and redirect the user to our dashboard view.

    Dashboard.png

3. The user will click the Storage node and he will be redirected to the storage collection view (Storage Tab). It shows two storages.

      MLA Collection View.png

4. User go back to our home view, this time he will pick CEBU and repeat step 3, now notice that it refreshed the left pane but not the main view. CEBU should not have any storages.

       CEBU Collection View.png

How we implement it:

1. We used the Chassis example provided by the SDK.

2. In the ObjectStore, we defined a variable just like the rackMap.

    private final Map<String, Storage> _storageMap = new HashMap<String, Storage>();

Every time the user select a system from the home view, the said variable is being cleared and getting populated by new records based on the selected system. Something like this:

public void InitializeObjects) {

    _storageMap.clear();

     List<StorageInfo> storages = some web service

     if (storages != null && storages.size() > 0) {

        for (StorageInfo st: storages) {

           addStorage(st); // this will add the storage to the _storageMap.

        }

     }

}

Now the issue that we are having is that the objects tab view is not getting refreshed. I'm not sure if this is possible or if there's a work around to get the said view refreshed. Please help. 🙂

Regards,

Michael

0 Kudos
6 Replies
laurentsd
VMware Employee
VMware Employee

If you put a break-point in your data adapter code which returns the storage objects what do you see when you repeat step 3?

Also, if you go the other way, i.e. selecting the case where there is no storage object first, and then selecting the case where there are two, does the list stay empty or show the 2 objects?

0 Kudos
MichaelLee81
Contributor
Contributor

Hi laurentsd

1. If i put a break point in the data adapter, it returns null or zero item count.

2. If I go with CEBU first then MLA, MLA shows empty list instead of 2 strorages.

It seems that the grid in the Objects tab main view is not getting refreshed, I need to hit the vSphere Web Client refresh button to refresh get the expected result.

0 Kudos
laurentsd
VMware Employee
VMware Employee

> If i put a break point in the data adapter, it returns null or zero item count.

This is your code. Can you tell why it returns null?

Ideally if you could modify the current chassis sample just enough to reproduce your problem that would allow us to see what's wrong.

0 Kudos
MichaelLee81
Contributor
Contributor

I can try doing that. Do you want me to send the code of the the chassis example with our changes?

0 Kudos
irahov
VMware Employee
VMware Employee

Could you please verify that this is not a browser caching issue?

For example you can turn off the browser cache, there is an option in Chrome: 

'Disable cache (while DevTools is open)'

So you can check it and retest with DevTools being opened.

0 Kudos
laurentsd
VMware Employee
VMware Employee

Just enough so that I can rebuild the modified sample and see the problem myself. Thanks.

0 Kudos