[Lift] Re: Using Jx classes to output HTML

2009-04-16 Thread marius d.
On Apr 16, 12:58 am, glenn gl...@exmbly.com wrote: Marius, I appreciate the reply. Not sure if it helps, though. What's with (JsVar(items) and why did you use that? items is the same with your list variable. use JsVar(list) The Liftbook is very cryptic on the use of Jx classes. It just

[Lift] Re: Using Jx classes to output HTML

2009-04-16 Thread marius d.
Again LiftBook examples are working example ... I can double check today though. Could you send me a minimalistic example (and not just snippet) that does not work? Br's, Marius On Apr 16, 1:19 am, glenn gl...@exmbly.com wrote: Actually, the json example code in the Liftbook works, as long

[Lift] Re: Using Jx classes to output HTML

2009-04-16 Thread glenn
Perhaps the best way to explain it is to inquire as to just what is the minimal snippet code needed to call a javascript function emitted on the client using Jx ( ). Such a function could be used to dynamically create html, such as a series of li's, from a json object. A skeleton snippet to do

[Lift] Re: Using Jx classes to output HTML

2009-04-16 Thread glenn
Marius, You asked about the Java version I'm using and why I couldn't run the Liftbook example as-is. My development environment is Eclipse with the scala plugin running Java 1.6. I assume I'm always compiling with the latest scala/lift libraries, as I use maven to package and run. I get the

[Lift] Re: Using Jx classes to output HTML

2009-04-16 Thread marius d.
Glenn, It looks like there was a typo in the book: bind(ex, xhtml, button - SHtml.ajaxButton(Text(Press me), ajaxFunc _) // missing underscore for partial function application If you want to use Jx when say pressing a button ... is it Ajax something that you're looking for? .. such as:

[Lift] Re: Using Jx classes to output HTML

2009-04-16 Thread glenn
Marius, This is definitely getting closer. One question? I don't understand why you used this function to handle the button clicked event. val matches = names.filter(e = e.indexOf(value) -1 Where does the 'names' list and 'value' param come from? Glenn Silverman On Apr 16, 9:26 am, marius

[Lift] Re: Using Jx classes to output HTML

2009-04-16 Thread glenn
Marius, Here's what I tried, based on your sample code: class MyList { val json = JsObj((tabs, JsArray( JsObj((class - posts selected)), JsObj((class - comments)), JsObj((class - category)), JsObj((class

[Lift] Re: Using Jx classes to output HTML

2009-04-16 Thread marius d.
Glenn, I just tested the code and it is working correctly. Here is my full class source: package lifttest.snippet import _root_.scala.xml._ import _root_.net.liftweb.http.js._ import JE._ import _root_. net.liftweb.http.js.jquery.JqJE._ import _root_.net.liftweb.http.SHtml._ import

[Lift] Re: Using Jx classes to output HTML

2009-04-16 Thread glenn
Marius, Now, we're getting somewhere. I think where I was stumped was how to actually call the function with the correct items and populate the div. That's where (ElemById(items_list) ~ JsFunc(appendChild, Call (func, JsVar(items) comes into play, and I thank you for that insight. That being

[Lift] Re: Using Jx classes to output HTML

2009-04-15 Thread glenn
Marius, I appreciate the reply. Not sure if it helps, though. What's with (JsVar(items) and why did you use that? The Liftbook is very cryptic on the use of Jx classes. It just says, If we send this generated JavaScript function to client and calling it by pass the list variable above It will

[Lift] Re: Using Jx classes to output HTML

2009-04-15 Thread glenn
Actually, the json example code in the Liftbook works, as long as you change it to read: bind(ex, xhtml, button - SHtml.ajaxButton(Text(Press me), () = ajaxFunc) But this example uses a simple function, alert, and emits it using JsRaw. I would like to see a similar example, but using Jx to