a!localVariables( local!fieldName:"5", local!operator:">", local!value:"2", a!textField( value: fv!item.fieldName, saveInto: fv!item.fieldName, validations: { a!validationMessage( message:"test", showWhen: local!fieldName & local!operator & local!value ) } ) )
Discussion posts and replies are publicly visible
Showwhen will apply only when the result is true or false.Could you please elaborate the exact requirement what to achieve.
yes, I want the showWhen condition to be dynamic so that the conditional operators I use in it should be coming from a local variables & also for the left & right condition. e.g. I want to write "5>2" in showWhen but I have 3 local variables instead which will be: local!fieldName:"5", local!operator:">", local!value:"2",So is there a way to do this because these variables values can change
a!match( value: local!operator, equals: ">", then: local!fieldName > local!value, equals: "=", then: local!fieldName = local!value, equals: "<", then: local!fieldName < local!value, /*....more operators*/ default: {} )