On 2 March 2010 15:09, ced <docpom...@googlemail.com> wrote: > 3) How do I get access to the CometActor instance on the page? I need > > to send a message to it from a function bound to e.g. an ajaxSelect > > You need another Actor that dispatches messages to your CometActors. > Say you have ChartCometActor, then implement something like > object ChartManager extends Actor { > ... > } > where all your CharCometActors register at creation time. Override > localSetup() for this. Also override localShutdown() to unregister. > Your snippet function then sends a message to the ChartManager who's > responsible for dispatching to all/one actor/s. I use a solution where > I register the CometActors an a session basis, so I can send a message > either to all or just one CometActor. > > Or use
object ChartServer extends LiftActor with ListenerManager { ... override def lowPriority = { case ... => { ... updateListeners() } } } and class ChartActor extends CometActor with CometListener { override def registerWith = ChartServer // Only necessary if you do not want to send the message to all comet actors override def shouldUpdate = { case ... => // Decide whether this instance should receive a message } } Look at http://github.com/weiglewilczek/chatter for a full blown example. Heiko Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.