It looks like I will have to define the functions within a render call
and use the SHtml.ajaxCall function, since the destination url is
randomized. I am just wondering what would be the idiomatic way to do
this.
This is for a chat style app which processes/distributes data by the
keystroke rather than by a line/post command.
I'm open to any ideas / alternate suggestions.
Thanks,
Rick
--
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.
With regards to using custom javascript functions, I have a function
processKeyPress. It's role is to filter key presses, only send events
to the server upon certain key presses.
I guess the easiest way to handle this would be to pass the function created by:
{jsonCall("pressed", JsRaw("event.which")).toJsCmd}
into processKeyPress so that it can invoke it if the event.which is
the correct type.
Unfortunately, I can't come up with a way to describe this in inline XML.
<input type="textarea" onkeypress="processKeyPress(event.which,
{jsonCall("pressed", JsRaw("event.which")).toJsCmd})"/>
leaving out the " causes a parse error.. adding the " cause it to be
evaulated as a string.
Any ideas?
-Ross
so it's attempting to execute the F37...
also, I don't know if the semicolon is allowed inside the parens.
Is there a way I can pass the function pointer separate from its params?
That works beautifully, thanks.
With regards to using custom javascript functions, I have a function
processKeyPress. It's role is to filter key presses, only send events
to the server upon certain key presses.
I guess the easiest way to handle this would be to pass the function created by:
{jsonCall("pressed", JsRaw("event.which")).toJsCmd}
Of course. The old wrap it in another function trick. I need to get more sleep.
Thanks for your help and patience on this.
>> {jsonCall("pressed", JsRaw("event.which")).toJsCmd}Of course. The old wrap it in another function trick.
>
> How about:
>
> onkeypress={"processKeyPress(function(a) {"+jsonCall("pressed",
> JsRaw("a")).toJsCmd+"})"}
>
> This will pass a function to the processKeyPress method. If you want to
> send the message, you call the function with the value to send to the
> server.
>
I need to get more sleep.
Thanks for your help and patience on this.
--
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.