Thanks again, what i want to do is some stuff with a canvas element, where changes are reflected to the other clients. This why i think the SHtml things do not fit for me. I now think the best way would be to use the partialUpdate() of the CometActor to send changes to clients and may be a JsonHandler to to get the updates to Server.
Sorry if i expressed my concerns unclear. In the end it seems not that complicated as i tried to make it :). Martin On 4 Jan., 15:19, Marius <marius.dan...@gmail.com> wrote: > From your render method you can return something like: > > ajaxText("Hello", (text) => { > println("text is: " + text) > // do something here and return a JsCmd. Thus you can return a JsRaw, > a Call or whatever java script you want > > }) > > F1162097909104VYK has nothing to do with Comet. It is an opaque ID > generated by lift that is bound to the function you specified in the > ajaxText call. Based on this information Lift will know to invoke the > proper Scala function when the ajax request is sent to server when you > hit enter in your text field or something. > > What function you want to build. With Lift you rarely want to call > ajaxInvoke etc, as SHtml provides a bunch of Ajax helpers (such as > ajaxText) > > Br's, > Marius > > On Jan 4, 3:36 pm, "martinsema...@googlemail.com" > > <martinsema...@googlemail.com> wrote: > > Thanks for that Marius, > > it works, but it is only for the server to client direction. > > > In the generated Html of the ajaxText there is something like: > > > lift_ajaxHandler('F1162097909104VYK=' + encodeURIComponent > > (this.value), null, null) > > > I guess the F116... is some kind of Id for the receiving Actor. Can i > > get it from the scala side to build my own function? I tried > > SHtml.ajaxCallto build a function that can send to to the Actor, but > > it seems not to work. Any suggestions? > > > best regards > > Martin > > > On 4 Jan., 13:36, Marius <marius.dan...@gmail.com> wrote: > > > > Do not disable Lift's ajax. > > > > Let's say you have your own myown.js file having say a function foo(). > > > Now you from a CometActor you want to call this function (assume to > > > included myown.js in your page head). > > > > When you receive a message in your comet you can call partialUpdate > > > like: > > > > case MyMessage => > > > partialUpdate(Call("foo")) > > > > Call is a JsCmd object from lift witch translates into a JS function > > > call. You can also use JsRaw("put here any js code") > > > > You can also do it from render as well like: > > > > def render = { > > > // do something > > > new RenderOut(some_xhtml, Call("foo")) > > > > } > > > > Br's, > > > Marius > > > > On Jan 4, 1:30 pm, "martinsema...@googlemail.com" > > > > <martinsema...@googlemail.com> wrote: > > > > Hi all > > > > if just started exploring Lift and I am playing around with CometActor > > > > and Listeneers. I followed Davids Screencast with the Chat Example > > > > which works nicely. > > > > Now i would like to communicate with the CometActors using my own > > > > jQuery code. I don't want to use lifts helpers for that, but want to > > > > use my own static JS code. > > > > > How would the send and receive functions look like? Should i disable > > > > lifts ajax support or can i plug in somehow? > > > > > I have no clue how to begin. Can someone point to some examples or > > > > article that is concerned with this type of stuff? > > > > > thanks in advance! > > > > Martin -- 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.