Hi, this has nothing to do with variables. In Scala if is an expression (equivalent to the `?` of Java), so you can just write:
@inputText(
…,
args = '_label -> "Username", 'disabled -> if (action == "disable") "disabled" else "enabled"
)
You could define an intermediate value for the result of the `if`, if you want to:
@defining(if (action == "disable") "disabled" else "enabled") { disabled =>
@InputText(
…,
args = '_label -> "Username", 'disabled -> disabled
)
}
By the way comparing String values is a weak design, I would prefer to use an enumeration or a sum type.
Regards,
Julien