tags:

views:

91

answers:

2

A newbie scala/lift question:

I checked out the CalendarMonthView sample:

http://scala-tools.org/mvnsites/liftweb-1.0/lift-widgets/scaladocs/net/liftweb/widgets/calendars/CalendarMonthView.html

with Lift 1.1-M6 and it compiled and worked.

When i tried to migrate the sample to Lift 1.1-SNAPSHOT the signature of AnonFunc seems to have changed from class JsRaw to JsCmd (which is a trait).

The compiler fails here:

def itemClick = Full(AnonFunc("elem, param", JsCmd("alert('itemClick' + param + ' - ' + elem.nodeName)")))

not found: value JsCmd

am i missing something ?

Regards Paul

A: 

Try using net.liftweb.http.js.JE.JsRaw instead of JsCmd:

def itemClick = Full(AnonFunc("elem, param", JsRaw("alert('itemClick' + param + '-' + elem.nodeName)")))

I'm not sure if that will pass through your elem and param from the AnonFunc, but I believe so

Aaron
Aaron, thanks for your comment. My Problem is that the signature of the AnonFunc in Lift 1.1-SNAPSHOT has changed to:def apply(s : scala.Predef.String, j : net.liftweb.http.js.JsCmd) : net.liftweb.http.js.JE.AnonFunc = { /* compiled code */ }
earthling paul
+1  A: 

I found the new Lift 1.1-SNAPSHOT implementation of the CalendarMonthView sample in the sub-project

/lift-modules/lift-widgets

which has other quite impressive widget samples :-)

The best way is to get the whole liftweb repo via:

git clone git://github.com/dpp/liftweb.git

earthling paul