SetHtml
returns a JsCmd
, but in order for that to be sent to the browser it would need to be part of a server response. However, as you are calling it asynchronously there is no response to send it with and therefore the browser never receives it. To fix that you have two options:
- Wait for the future to finish by blocking, something like having
your function return
future.get
- Use an actor which allows for server push communication with the browser. In that way, your future could send a message to the actor upon completion and then the actor would send the
setHtml
command.
There is a quick example with Lift actors here (unfortunately uses the old bind syntax in render) which illustrates how to send a message and have that execute setHtml
: https://www.assembla.com/wiki/show/liftweb/Comet_Support