Comet calling Javascript

51 views
Skip to first unread message

Jimmy

unread,
Oct 25, 2010, 5:11:18 PM10/25/10
to Lift
Hi all,
Are there any examples of a CometActor calling javascript functions
with arguments?
Regards,
Jimmy

David Pollak

unread,
Oct 25, 2010, 8:02:10 PM10/25/10
to lif...@googlegroups.com
On Mon, Oct 25, 2010 at 2:11 PM, Jimmy <jimmy...@gmail.com> wrote:
Hi all,
Are there any examples of a CometActor calling javascript functions
with arguments?

Do you mean the CometActor sending JavaScript as part of any update or having the browser send a message to the CometActor?


 
Regards,
Jimmy

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Jimmy

unread,
Oct 26, 2010, 3:13:36 AM10/26/10
to Lift
Hi David,
Instead of binding content to tags as shown in the getting started
CometActor chat application, i would like to invoke an existing
Javascript function on the client, passing parameters - in my case
the Javascript would perform some logic and the update the UI.
Regards,
Jimmy


On Oct 26, 1:02 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Mon, Oct 25, 2010 at 2:11 PM, Jimmy <jimmy.co...@gmail.com> wrote:
> > Hi all,
> > Are there any examples of a CometActor calling javascript functions
> > with arguments?
>
> Do you mean the CometActor sending JavaScript as part of any update or
> having the browser send a message to the CometActor?
>
> > Regards,
> > Jimmy
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lif...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

David Pollak

unread,
Oct 26, 2010, 9:00:22 AM10/26/10
to lif...@googlegroups.com
On Tue, Oct 26, 2010 at 12:13 AM, Jimmy <jimmy...@gmail.com> wrote:
Hi David,
Instead of binding content to tags as shown in the getting started
CometActor chat application, i would like to invoke an existing
Javascript function on the client, passing parameters -  in my case
the Javascript would perform some logic and the update the UI.
Regards,
Jimmy

package code.comet

import net.liftweb._
import http._
import js._
import JsCmds._
import JE._
import util._

class MyCometDude extends CometActor {
  def render = Call("my_js_func", Helpers.randomString(20))

  override def lowPriority = {
    case s: String => partialUpdate(Call("my_js_func", s))
  }
}

 
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890

Jimmy

unread,
Oct 26, 2010, 3:04:17 PM10/26/10
to Lift

That's pretty cool! Thanks.
Reply all
Reply to author
Forward
0 new messages