Wednesday, January 28, 2015

What is difference between Action function and remote function?

What is difference between Action function and remote function?

1. Using action function, you can call only same class function.
2. Remote Action returns the results from the class in Javascript.
3. Action function submit the page, Remote action doesn't

Remote Action in Visual force page:
JavaScript remoting in Visualforce provides support for some methods in Apex controllers to be called via JavaScript.

• namespace is your organization's namespace. This is only required if the class comes from an installed packaged.
• controller is the name of your Apex controller- MyJSControllers
• method is the name of the Apex method you're calling- getAccount
• params is comma–separated list of parameters that your method takes-accountNameJS
• callbackFunction is the name of the function that handles the response from the controller. It returns the status of the call and the method result.- function
• escape defines whether your response should be escaped (by default, true) or not (false)- {escape:true}

·    JavaScript remoting:
- pass parameters
- provides a callback
·        The <apex:actionFunction> tag:
- specify rerender targets
- submits the form


Post a Comment

| ,