I know this is very much a noob question...
I see lift provides utilities methods to generate javascript commands. I want to do the equivalent of:
JsIf((JsEq(ValById("disable-production"),JsTrue) || JsEq(ValById("disable-production"), JsTrue) , {
Alert("Do something interesting...")
})
Thanks.
Yes, there is:
import net.liftweb.http.js.JsCmds._
import net.liftweb.http.js.JE._
val conditional = JsIf(
JsOr(
JsEq(ValById("disable-production"), JsTrue),
JsEq(ValById("disable-something-else"), JsTrue)
),
Alert("Do something interesting...")
)
You would probably be better off writing this directly in string form and then evaluating it using JsExp.strToJValue(<your expression>)
.
However, the direct answer to your question would be JE.JsOr
.
JsIf((JE.JsOr(JsEq(ValById("disable-production"),JsTrue),
JsEq(ValById("disable-production"), JsTrue)) , {
Alert("Do something interesting...")
})