Action as JavaScript Function
The action component actionFunction
allows you to call an Apex method in the controller as a JavaScript function. This decouples the user interface representation of the action from the action itself. You’ve already experienced action components that require a user to click a link or button to trigger a controller action. With actionFunction
, you can call an action from anywhere in your page, including custom JavaScript code.
To use the actionFunction
component, minimally specify an action to invoke in the action
attribute, a JavaScript function name in the name
attribute, and enclose it in a form
component. Optionally, you can define arguments on the function by nesting param
components inside the actionFunction ...
Get Development with the Force.com Platform: Building Business Applications in the Cloud, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.