exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 79 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 79
Topic #: 1
[All Certified Platform Developer II Questions]

A developer is using a third-party JavaScript library to create a custom user interface in Visualforce. The developer needs to use JavaScript to get data from a controller method in response to a user action.
How can the developer accomplish this?

  • A. Use <apex:actionFunction> to create a JavaScript wrapper for the controller method
  • B. Use the @RemoteAction annotation on the method definition with JavaScript Remoting
  • C. Use the $Controller global variable to access the controller method via JavaScript
  • D. Use <apex:actionSupport> to enable JavaScript support for the controller method
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
vancika
1 month ago
Selected Answer: B
B. Use the @RemoteAction annotation on the method definition with JavaScript Remoting. JavaScript Remoting: By using the @RemoteAction annotation, a static controller method can be invoked directly from JavaScript. This allows the integration of third-party JavaScript libraries with Visualforce. Asynchronous Calls: JavaScript Remoting supports asynchronous calls with callback functions, providing a responsive user experience when the controller method is called in response to user actions. Simplicity: This approach avoids the need to wrap the controller method in an <apex:actionFunction> or <apex:actionSupport>, which are more tightly coupled to Visualforce components.
upvoted 1 times
...
ajithk47
8 months, 2 weeks ago
Answer B Javascript remoting is correct as actionSupport does not provide javascript support. It calls the controller method directly for the selected user action.
upvoted 4 times
...
GGJJ
8 months, 4 weeks ago
Selected Answer: D
it should be D as involves a user action
upvoted 1 times
BrainMelt12
1 month, 2 weeks ago
<apex:actionSupport> does not provide direct JavaScript interaction with the controller
upvoted 1 times
...
...
lorenac2
10 months, 1 week ago
Reference: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_js_remoting_declaring_remote_method.htm
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago