Hi,
I was looking around LiftSession and I found
addPostPageJavaScript
So I figured to try it out on a comet class and what I found is that
th JsCmd appears twice on the page.
I added first to fixedRender like this:
override def fixedRender: Box[NodeSeq] = {
S.session map { sess =>
sess.addPostPageJavaScript( () => JsCmds.Alert("hi") )
}
logger.info("called fixed render")
NodeSeq.Empty
}
and the html now has:
<div id="F773049348455MWBFT4_outer" style="display: inline"><div
id="F773049348455MWBFT4" style="display: inline"><div></div><script
type="text/javascript">
// <![CDATA[
jQuery(document).ready(function() {
alert("hi");});
/* JSON Func comet $$ F773049348458LZR2OV */function
F773049348458LZR2OV(obj)
{liftAjax.lift_ajaxHandler('F773049348458LZR2OV='+
encodeURIComponent(JSON.stringify(obj)), null,null);}
// ]]>
</script></div><script type="text/javascript">
// <![CDATA[
var destroy_F773049348455MWBFT4 = function() {}
// ]]>
</script><script type="text/javascript">
// <![CDATA[
alert("hi");
// ]]>
</script></div>
</div>
(note the alert("hi") twice there. Is this expected?
Thanks
Diego
--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://fmpwizard.telegr.am