VMware Cloud Community
AnonymousDefaul
Enthusiast
Enthusiast

How can I change a stringParameter when enable/disable a booleanParamter on the same page?

For example I have to set the port number to 443 or 80 if a https checkbox is enabled or disabled.

Labels (1)
0 Kudos
1 Reply
AnonymousDefaul
Enthusiast
Enthusiast

It is not possible to dynamically modify values in a page when clicking in a checkbox. As an alternative, you could try using a <choiceParameterGroup> with two options, each of them with a different port:

<choiceParameterGroup>     <name>protocol</name>     <title>Protocol</title>     <description>Protocol</description>     <value>http</value>     <parameterList>         <parameterGroup>             <name>http</name>             <explanation>HTTP</explanation>             <parameterList>                 <stringParameter>                     <name>httpPort</name>                     <description>Port</description>                     <value>80</value>                 </stringParameter>             </parameterList>         </parameterGroup>         <parameterGroup>             <name>https</name>             <explanation>HTTPS</explanation>             <parameterList>                 <stringParameter>                     <name>httpsPort</name>                     <description>Port</description>                     <value>443</value>                 </stringParameter>             </parameterList>         </parameterGroup>     </parameterList> </choiceParameterGroup> 

In the example, both options allow configuring the port but you could use a <labelParameter> to display a read-only version. It also uses parameter groups as options, in case you want to add more settings there but you could also just use the string parameters:

<choiceParameterGroup>     <name>protocol</name>     <title>Protocol</title>     <description>Protocol</description>     <value>http</value>     <parameterList>          <stringParameter>                <name>httpPort</name>                <description>HTTP Port</description>                <value>80</value>          </stringParameter>          <stringParameter>                <name>httpsPort</name>                <description>HTTPS Port</description>               <value>443</value>          </stringParameter>     </parameterList> </choiceParameterGroup> 

You can find additional information about the usage of the <choiceParameterGroup> here

0 Kudos