If you want to send data to a CometActor when it initializes from
Scala code (e.g. a snippet), try this:
for (session <- S.session) {
session.setupComet("myCometActor", Empty, myMessage)
}
Peter
On Mar 2, 3:36 pm, Rick R <[email protected]> wrote:
> > They are not being rendered in reverse. There is no problem. The code
> > works correctly.
> > Why?
> > First, the code in the CometActor is a call a function in response to an
> > event. The page will be loaded before you can press the button or otherwise
> > cause the event to be dispatched.
> > Second, as I said in my first response, the code in liftAjax only gets
> > executed after the page is loaded... that means if there's some random event
> > that causes the page parsing to be delayed until after the liftAjax.js file
> > is loaded and parsed, the calls in liftAjax that reference the variables on
> > the page is not going to get executed until after the page is completely
> > loaded (which also means the page is parsed and the inline JavaScript code
> > is executed.)
>
> Thanks for clarifying. Upon page load, I am attempting to make a
> JsonCall "connect" to the CometActor. This is how I intend to get the
> parameter created by the RewriteRequest function to the CometActor.
> So that it can use that param to fetch a previously allocated
> resource.
>
> I noticed a failure, which is why I posted to the list. The failure
> was that my call to to the comet server occurred before liftAjax.js
> was loaded. Thus causing javascript to stop evaluating and my json
> call to not occur.
>
> Thanks to your explanation above, I now realize that I should probably
> use some mechanism to specify that my jsonCall occurs on the
> body.onLoad event, or something like it, rather than being executed
> inline.
>
> Could you provide guidance in this area? Because I can't find anything
> in the docs that would allow me to specify such a task from scala
> source. I could just hack something $(document).ready, but I was
> hoping to go for as much Lift as possible.
>
> Thanks.
--
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.