--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Torsten,
Thanks for reading it. I'm not sure I understand your question.
The way the technique 2 and 3 work is that Lift just sends the raw data, and the client side decides what to do with it and how to add it to the html.
Thanks!
Diego
Sent from my android cell
$(document).trigger('new-ko-chat', %s)JE.JsRaw("""newKoChat(/* data as json */)""")ChatServer ! s + myFunctionThatReadsSomething(something)
case class myFunctionThatReadsSomething(something: String) extends JsExp {
def to JsCmd = // js stuff
}implicit val format = DefaultFormats
val msg = j.extractOpt[String]JObject(List(JField(par1, JDouble(1234)), JField(par2, JDouble(5678))))Hi,
First, I find this link super useful
https://github.com/lift/framework/tree/master/core/json
In your case, you don't need a custom format, either a case class that has those two fields, or the \ operator should do
Hope that helps
Diego
Sent from my android cell
override def lowPriority = {
case p: MyClass =>
lastMessage = p
partialUpdate(NewMessage(lastMessage))
case InitialRender =>
partialUpdate(NewMessage(lastMessage))
} def render = {
this ! InitialRender
ClearClearable
}Hi Dario,
Am 17.03.2013 11:43 schrieb "Dario Oddenino" <bran...@gmail.com>:
>
> Hi Diego,
> it works, but I'm failing to see how this is happening.
>
> My lowPriority method
>
> override def lowPriority = {
> case p: MyClass =>
> lastMessage = p
> partialUpdate(NewMessage(lastMessage))
> case InitialRender =>
> partialUpdate(NewMessage(lastMessage))
> }
>
> I don't understand who or what is sending this InitialRender message.
>
> def render = {
> this ! InitialRender
> ClearClearable
> }
>
> The "this ! InitialRender" is returning a Boolean? What for?
No, as you can see in https://github.com/fmpwizard/lift_starter_2.4/blob/compare-chat-apps-comet-lift/src/main/scala/code/comet/ChatKnockOutJs.scala
the class itself is an actor. Initially on request the render method is called. "this ! InitialRender" sends a message InitialRender to itself, the actor instance. So you will find the case InitialRender =>
partialUpdate(InitialMessages( msgs ))
}
that will do a partialUpdate sending a js cmd including all existing msgs. Inside the js cmd an event will be triggered so knockout can do its work.
Hope that help s (have not read the whole thread)
Christian
> You received this message because you are subscribed to a topic in the Google Groups "Lift" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/liftweb/mJkBoin4SQU/unsubscribe?hl=en-US.
> To unsubscribe from this group and all its topics, send an email to liftweb+u...@googlegroups.com.