VMware {code} Community
dvk78
Contributor
Contributor
Jump to solution

--> Is a dynamic UI in global workspace view possible?

Hi,

I need to generate a workspace view (probably global) based on some object attributes. I will be getting the attributes via a REST call. I would like to confirm from an expert here if it would be possible to render a workspace view based on the response of the REST call. It will have the metadata of the attributes that would be used for rendering the object's attributes.

I am yet to read up the docs in detail. Just wanted to know if this dynamic UI generation is possible with the vSphere WC extension framework. If yes, I can use this approach to add the extension to the client, otherwise have to resort to a normal webapp, which is a standy-option for now.

Thanks in advance.

1 Solution

Accepted Solutions
laurentsd
VMware Employee
VMware Employee
Jump to solution

If your question is "can I change some view extension data based on the result of a rest call?"  the answer is no.  Extension data is defined in plugin.xml statically.

But if you mean "can the UI rendered in some existing view be triggered by the result of an initial rest call?"  the answer is: yes, it's just a web app and you can render anything you want in that view.

And if I didn't quite understand your use case, please add details 🙂

View solution in original post

4 Replies
laurentsd
VMware Employee
VMware Employee
Jump to solution

If your question is "can I change some view extension data based on the result of a rest call?"  the answer is no.  Extension data is defined in plugin.xml statically.

But if you mean "can the UI rendered in some existing view be triggered by the result of an initial rest call?"  the answer is: yes, it's just a web app and you can render anything you want in that view.

And if I didn't quite understand your use case, please add details 🙂

dvk78
Contributor
Contributor
Jump to solution

Thanks for the quick revert. At the outset the answer seems a 'no'.

Nevertheless, let me try to re-phrase my question for more clarity.

I am planning to create a screen which is like a form-builder.

1) First make a REST call and find all the fields that need to be displayed on the form. The JSON response will contain the list of fields that need to be displayed in the form on the next screen. It will have their data types, mandatory or not flag, whether input/read-only flag and may be a few other metadata.

2) After parsing the JSON response, my screen would have to generate the form with the above fields (input/read-only) according to the metadata that was associated with each field

3) The user would fill-up the input fields and POST it to a server for interacting with the vsphere and my other custom objects

0 Kudos
dvk78
Contributor
Contributor
Jump to solution

After re-reading your answer a couple of times, it looks like it is possible indeed. Anyways kindly confirm after going through my previous comment which has my question rephrased.

0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

Your HTML content can be initialized anyway you want, including by making a REST call first to find out which form to display.

Remember that you are in complete control inside that HTML document.

0 Kudos