VMware {code} Community
CathyBr
Enthusiast
Enthusiast
Jump to solution

How to determine if htmlSdk.modal api can be used.

Hi,

we had a problem with the new HTML Client.  In one of our views, we start a wizard, in which a user has to make choises about some settings.  These settings are quite involved, and have to be displayed correctly for the user to be able to choose.  Since our wizard could only be as big as the IFRAME which contains our views, we had problems displaying the values...

THANKS to the modal in the htmSdk, we have much more room to show everything, and it is now usable.  The modal is very easy to use, and works quite well!!!  I can recommend it.

Just the one question though...

Our plug-in works in both the FLEX and the HTML Client, so we have to determine when the htmlSdk.modal can be used, and when not.  If I understand correctly, it should only be used if the Client has version 6.5 U2 and greater...

I've used the following to make the decision:

var useSDKModal = WEB_PLATFORM.getClientType() != "flex";

But I don't think that this is good enough - can you suggest a better way?  What if the user has WebClient version 6.5 U1??

thanks for the info

Cathy

Reply
0 Kudos
1 Solution

Accepted Solutions
Denis_Chorbadzh
VMware Employee
VMware Employee
Jump to solution

Hi Cathy,

 

In order to get more information about the current type and version of your vSphere Client, you can use the "getClientInfo()" API.

If you type "window.frameElement.htmlClientSdk.app.getClientInfo()" it will return something like: {type: "html", version: "6.5.0.20000"}

This way, you know that you are on a vSphere HTML Client from 6.5U2

 

Best Regards,

Denis

View solution in original post

Reply
0 Kudos
3 Replies
Denis_Chorbadzh
VMware Employee
VMware Employee
Jump to solution

Hi Cathy,

 

In order to get more information about the current type and version of your vSphere Client, you can use the "getClientInfo()" API.

If you type "window.frameElement.htmlClientSdk.app.getClientInfo()" it will return something like: {type: "html", version: "6.5.0.20000"}

This way, you know that you are on a vSphere HTML Client from 6.5U2

 

Best Regards,

Denis

Reply
0 Kudos
CathyBr
Enthusiast
Enthusiast
Jump to solution

Ok thanks very much!

Reply
0 Kudos
Denis_Chorbadzh
VMware Employee
VMware Employee
Jump to solution

Hi Cathy,

 

Generally, if you want to check if the new JS APIs are present in a given vSphere Client, you can use:

if (window.frameElement.htmlClientSdk) {

// use the new JS APIs

} else {

// use the old JS APIs

}

Reply
0 Kudos