jsu
unread,Nov 14, 2011, 1:50:54 PM11/14/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Lift
Hello, I am trying to get Comet to work with html5 markup. I can only
get the default render to show up. Are there any samples of html5
CometActor markup? In my sample below only "Testing comet!" shows up.
comet.html:
<div class="lift:CometExample"></div>
CometExample.scala:
package code.snippet
import net.liftweb.http._
import net.liftweb.util._
import net.liftweb.actor._
import net.liftweb.http.js.JsCmds.{SetHtml}
import scala.xml._
class CometExample extends CometActor {
def render = {
<section id="cometId">Testing comet!</section>
}
def render(in: NodeSeq): NodeSeq = {
<section id="cometId">Default render...</section>
}
ActorPing.schedule(this, Message, 10000L)
override def lowPriority : PartialFunction[Any,Unit] = {
case Message => {
partialUpdate(SetHtml("cometId", <section id="cometId">Updated!</
section>))
ActorPing.schedule(this, Message, 10000L)
}
}
case object Message
}