You need to sign in to do that
Don't have an account?
Calling controller method from JavaScript and Calling Javascript Function from controller
Can somebody explain what are the scenarios for both and how to implement them:
1. Calling controller method from JavaScript
2. Calling Javascript Function from controller
1. Calling controller method from JavaScript
2. Calling Javascript Function from controller
This is example to Calling controller method from JavaScript and alling Javascript Function from controller controllerhttp://mirketa.com
Thanks
Rupal kumar
1. Calling controller method from JavaScript
Scenario : when you have some javascript libraries being used on your vf page and you want to invoke some apex method from javascript.
how to call? Invoke an actionFunction from javascript which in turn will call the apex function.
2. Calling Javascript Function from controller
Scenario : when after performing some logic in apex, you want some action on the page using script.
how to call? You cannot directly call a javascript function from apex class. What you can instead do is, in the oncomplete of your actionFunction that has invoked the apex method, call a javascript method you would want to execute.
I have given very high level details assuming you just want to get an idea.
Thanks Vishal for the clarification!!
Could you please share any code if you have for both implementation scenarios?
It's simple Example. We need some functionality in controller method (i.e myActionInController()).