a!radioButtonField( label: "Status",choiceLabels:{"APPROVE","REJECT","RETURN"}, choiceValues: :{"APPROVE","REJECT","RETURN"} ),
a!paragraphField( showwhen(...)
)
*if user selects Reject or Return, then only show the Paragraph field.
Discussion posts and replies are publicly visible
What is your question here? If it is about how you do it, then you must be saving the radio button selection somewhere. You can just use that variable to compare it with the needed value in front of showWhen.
hi, I think this will help you. Create two rule inputs as value and paravalue.
{ a!radioButtonField( label: "Status", labelPosition: "ABOVE", choiceLabels: {"APPROVE","REJECT","RETURN"}, choiceValues: {"APPROVE","REJECT","RETURN"}, value: ri!value, saveInto: {ri!value}, choiceLayout: "STACKED", validations: {} ), a!paragraphField( label: "Paragraph", labelPosition: "ABOVE", value: ri!paravalue, saveInto: {ri!paravalue}, refreshAfter: "UNFOCUS", height: "MEDIUM", validations: {}, showWhen: or(ri!value="REJECT",ri!value="RETURN") ) }
Thanks.
"ShowWhen" requires a boolean value (or null, which almost always evaluates as "true" by default). You can pass literally any boolean or "expression that evaluates as a boolean" to a ShowWhen parameter.
Beyond this, I typically recommend developers actually establish a local variable that will evaluate the logic and store the resulting boolean itself, as this functional abstraction helps with code readability and cuts way down on repetitive logic when similar code is needed elsewhere on a form (like if you had 4 or 5 fields all relying on the same condition for display, etc).