how to combine sequence of JsCmd in SHtml.ajaxCall?

61 views
Skip to first unread message

wm

unread,
Feb 10, 2010, 3:22:42 AM2/10/10
to Lift
Hi,

I have the following code:

def jsF(x: String): JsCmd = {
/*
JsCmds.SetHtml(...)
JsCmds.SetElemById(...)
*/
JE.JsRaw("alert('1')").cmd
JE.JsRaw("alert('2'); alert('3')").cmd // last cmd
}

<button onclick={SHtml.ajaxCall(Str(x), jsF _)._2}
</button>

when I tried, only the last cmd got executed, I know this is because
it's the return value for the whole function jsF().

I'm wondering is it possible to make it execute a sequence of JsCmd?
e.g. as the code that have been commented out? how this can be done in
Lift (instead of writing raw JsRaw)?

Thanks!

Marius

unread,
Feb 10, 2010, 7:59:00 AM2/10/10
to Lift

    (JsCmds.SetHtml(...) &
    JsCmds.SetElemById(...) &
    JE.JsRaw("alert('1')") &
    JE.JsRaw("alert('2'); alert('3')")).cmd


Br's,
Marius

Reply all
Reply to author
Forward
0 new messages