VMware {code} Community
ChrisSmith2
Enthusiast
Enthusiast
Jump to solution

Correct method to get built-in object icon resources?

What is the correct way to get and display an icon for a built-in object (e.g. for HostSystem, Datastore, etc.)?

By tracing the standard UI, I can retrieve the "primaryIconId" property from either my own objects or the VMWare-provided ones (HostSystem, Datastore). This returns a string, e.g. "vsphere-icon-datastore". However, passing this into ns.getString() just returns the same text, with "Resource key not found" output to the console. Trying "WEB_PLATFORM.getString("vsphere-icon", "datastore") returns "datastore" with "Bundle not found" on the console.

I found using WEB_PLATFORM.getString("commonImages", "datastore") - but this returns a 24x24 PNG graphic that isn't used in either the HTML or Flex UIs.

Is there a proper Javascript API call and/or example method to get the correct icon that will be consistent with the rest of the VMWare-provided UI?

Reply
0 Kudos
1 Solution

Accepted Solutions
laurentsd
VMware Employee
VMware Employee
Jump to solution

Sorry, there is no API to retrieve internal resources such as object icons.  What we have said in the past on this forum is that you are allowed to extract them manually from existing Web Client .war files and keep them in your plugin as long as they are used to represent the same objects.

View solution in original post

Reply
0 Kudos
2 Replies
laurentsd
VMware Employee
VMware Employee
Jump to solution

Sorry, there is no API to retrieve internal resources such as object icons.  What we have said in the past on this forum is that you are allowed to extract them manually from existing Web Client .war files and keep them in your plugin as long as they are used to represent the same objects.

Reply
0 Kudos
ChrisSmith2
Enthusiast
Enthusiast
Jump to solution

Thanks - we'll hard-code appropriate icons into our own resources then.

Reply
0 Kudos