Sv: [Lift] How to call a a javascript function from the scala code behind

202 views
Skip to first unread message

Andreas Joseph Krogh

unread,
Dec 27, 2012, 11:32:28 AM12/27/12
to lif...@googlegroups.com
På torsdag 27. desember 2012 kl. 15:29:33, skrev <amitya...@gmail.com>:
Hi !
 
Could you please help me  that how can I call a javascript function from my scala code file.
 
I have used the below alternatives but none of them worked out.I don’t see any compilation error but not working…still
 
Where ShowConfirmations is the function name and Amit is the parameter name…
 
1) JsCmds.Run("ShowConfirmation('Amit')
JsCmds.Run("provajavascript('ShowConfirmation');")
 
2)import net.liftweb.http.js.JE.JsRaw
JsRaw("ShowConfirmation()").cmd
 
3)Call("ShowConfirmation ")
 
4) JsRaw("ShowConfirmation(Amit)"). cmd
JsFunc("ShowConfirmation", "Amit").cmd                                                           
Script(Run(JsFunc("ShowConfirmation","amit")).toJsCmd)
 
Please reply me asap as I am really stuck up just because of this.
 
Hoping for  a fast response as I have heard about you people.
 
How are you trying to run this code, you're not telling us enough to help you...
 
--
Andreas Joseph Krogh <and...@officenet.no>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
 

Chenguang He

unread,
Dec 27, 2012, 11:34:48 AM12/27/12
to lif...@googlegroups.com
Can you show us a snippet that you have, which is with the codes below and not working?


Chenguang He




On Dec 27, 2012, at 8:29 AM, amitya...@gmail.com wrote:

Hi !

Could you please help me  that how can I call a javascript function from my scala code file.

I have used the below alternatives but none of them worked out.I don’t see any compilation error but not working…still

Where ShowConfirmations is the function name and Amit is the parameter name…

1) JsCmds.Run("ShowConfirmation('Amit')
JsCmds.Run("provajavascript('ShowConfirmation');")

2)import net.liftweb.http.js.JE.JsRaw
JsRaw("ShowConfirmation()").cmd

3)Call("ShowConfirmation ")

4) JsRaw("ShowConfirmation(Amit)"). cmd
JsFunc("ShowConfirmation", "Amit").cmd                                                           
Script(Run(JsFunc("ShowConfirmation","amit")).toJsCmd)

Please reply me asap as I am really stuck up just because of this.

Hoping for  a fast response as I have heard about you people.

Thanks
Amit Tyagi


--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 

Diego Medina

unread,
Dec 27, 2012, 11:37:41 AM12/27/12
to Lift
here there is a post that shows you one way to call scala code from javascript:

http://blog.fmpwizard.com/scala-lift-custom-wizard


Regards,

Diego
--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com

Diego Medina

unread,
Dec 27, 2012, 11:45:09 AM12/27/12
to Lift
sorry, I read your question the other way around, that was about
calling scala code from javascript.
Reply all
Reply to author
Forward
0 new messages