VMware Cloud Community
manfriday
Enthusiast
Enthusiast

validating drop down's in web-views

Hi!

I am working on creating a self-service provisioning portal, so our server admin's can generate new VM requets.

It has mostly been built on the vcoteam tutorial. (thanks guys!)

I have been expanding it to allow the admins to select the number of CPU's, amount of RAM, etc..

for the CPU and RAM input, I started out using an array of "Predefined answers", with a default value.

This worked great, except the user could choose "Select..." or "-------" as an option in the drop down, and the workflow would break.

What is the best way to validate for that in the webview?

Alternatively, I did see that there is an "Enums:vCPU" and "Enums:vRAM" variable type.

Those would be great, as the drop downs match the other dropdowns in the workflow..

At least tyhey would be if I could modify them so that the users can only select a maximum of 8GB of ram, or sort them so that the ram choices

are in order.

Thanks

Jason

0 Kudos
3 Replies
cdecanini_
VMware Employee
VMware Employee

The presentation has some validation properties..

For numbers you can use the Maximum / minimum properties.

You can also write an action validating the input and returning true if right and use the "custom validation" property with linking it to this action.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
manfriday
Enthusiast
Enthusiast

There must be something simple that I am missing, and I will probably be embarrased when I figure it out..

The validation of these fields does not occur until the form is submitted, at which point the workflow will just fail.

Any idea what I am doing wrong?

0 Kudos
manfriday
Enthusiast
Enthusiast

weird.

Ok, well, I managed to make this work by using variable of type 'string' rather than 'number'.

I set the variable to string, set an array of pre-defined answers, with a default value, and made it a mandatory field.

"Mandatory input" was not available for type 'Number', and it would let me select garbage data. Maybe it's a bug?

Thanks for your help!

0 Kudos