You need to sign in to do that
Don't have an account?

What is the use of Javascript Remoting ? when we need to use ?
Hi
can anyone pelase let me know below questions.
1. What is the use Javascript Remoting ?
2. If more flexible, When we need to use ?
3. What is the use of Actionfunction ?
4. What is the diffrenece between Actionfunction and Javascript remoting ?
5. JS remoting used for mainly calling the APEX method from javascript ? if yes what s the benefits ? can u please let me know real time scanerio ?
As of now, I know the js remoting the will be used for calling APEX method from javascript . i just want to know when we need to perform this ?
Thanks
Vinoth
1. What is the use Javascript Remoting ?
A) You can communicate with VF page's controller's methods without posting your form. Action Function posts the data.
2. If more flexible, When we need to use ?
A) JS remoting is not an alternate for Action function. There may arise a case in requirement to get/set some information or basically to perform an from controller without actually posting the form.
3. What is the use of Actionfunction ?
A) It posts data to to the controller. Unlike JS remoting you can rerender certain portions of your VF page. Because of this particual page rendering you can get refreshed values from server.
4. What is the diffrenece between Actionfunction and Javascript remoting ?
A)
i) Action function posts the form and JS Remoting does not
ii) Action function can do partial page rerendering which JS remoting can not.
5. JS remoting used for mainly calling the APEX method from javascript ? if yes what s the benefits ? can u please let me know real time scanerio ?
A)
i) Auto-complete search. for e.g. to list the articles titles while
ii) Any scenario where you dont want to refresh the page/no partial page rendering and just want to perform an action.
iii) Any scenario where you need to repetitively call controller without a need to rerender.
iv) There is a possibility to avoid View-State issue when you use JS remoting because you will just give back the data to the user but not keep it on the server which mounts to View-State.
All Answers
1. What is the use Javascript Remoting ?
A) You can communicate with VF page's controller's methods without posting your form. Action Function posts the data.
2. If more flexible, When we need to use ?
A) JS remoting is not an alternate for Action function. There may arise a case in requirement to get/set some information or basically to perform an from controller without actually posting the form.
3. What is the use of Actionfunction ?
A) It posts data to to the controller. Unlike JS remoting you can rerender certain portions of your VF page. Because of this particual page rendering you can get refreshed values from server.
4. What is the diffrenece between Actionfunction and Javascript remoting ?
A)
i) Action function posts the form and JS Remoting does not
ii) Action function can do partial page rerendering which JS remoting can not.
5. JS remoting used for mainly calling the APEX method from javascript ? if yes what s the benefits ? can u please let me know real time scanerio ?
A)
i) Auto-complete search. for e.g. to list the articles titles while
ii) Any scenario where you dont want to refresh the page/no partial page rendering and just want to perform an action.
iii) Any scenario where you need to repetitively call controller without a need to rerender.
iv) There is a possibility to avoid View-State issue when you use JS remoting because you will just give back the data to the user but not keep it on the server which mounts to View-State.
You the man ....
Thanks Ram...
Go to this lik to know how to use remoting on page with DEMO.
https://sfdcadda.blogspot.in/2017/05/use-of-javascript-remoting-on.html