I have 2 fields on my screen, 1 is a textfield and the other is a drop-down. When the drop-down has values A or B or C, the value allowed in the textfield should be a long only. When the user selects anything else other than A,B,C from drop-down, the textfield can contain anything.
I am trying to use validwhen.
<field property="selectedDropDownItem" depends="validwhen"> <msg key="error.invalid" name="validwhen"/> <var> <var-name>test</var-name> <var-value>( ((*this* == 'A' ) and (id == [a-zA-Z])) or ((*this* == 'B' ) and (id == [a-zA-Z])) or ((*this* == 'C' ) and (id == [a-zA-Z])))</var-value> </var> </field> id=[a-zA-Z] doesnt work nor does id =long. How do I give id field a different validation rule only when selectedDropDownItem = A or B or C ?