VMware Cloud Community
AnonymousDefaul
Enthusiast
Enthusiast

How to check if StringParameter is >=0 and <=65535

Hi,


Can you help me get the following code to work:


<stringParameter>
<name>https_proxy_port</name>
<title>${msg(proxy.https.port)}*</title>
<description>${msg(proxy.https.port)}*</description>
<explanation></explanation>
<value></value>
<default>${prev_https_proxy_port}</default>
<allowEmptyValue>0</allowEmptyValue>
<width>40</width>
<validationActionList>
<throwError text=' ${msg(proxy.https.port.invalid)}' >
<ruleList>
<stringTest text=' ${https_proxy_port}'  type=' digit'  negate=' 1'  />
<!-- below does not work -->
<!--compareValues>
<logic>greater</logic>
<value1>${https_proxy_port}</value1>
<value2>65535</value2>
</compareValues-->
</ruleList>
</throwError>
</validationActionList>
</stringParameter>


1st check (if input is a number) works ok, but as soon as I uncomment 2nd part, whole check stops to work


Thanks

Labels (1)
0 Kudos
1 Reply
michiel_dhont
Enthusiast
Enthusiast

Hi,

You need to set the <ruleEvaluationLogic> to OR as both rules can never be true at the same time.

<ruleEvaluationLogic></ruleEvaluationLogic>
<ruleList>
<stringTest text= or ' ${https_proxy_port} or '  type= or ' digit or '  negate= or ' 1 or '  />
<logic>greater</logic>
<value1>${https_proxy_port}</value1>
<value2>65535</value2>
</compareValues-->
</ruleList>

Regards,

Michiel

0 Kudos