Salesforce JavaScript in Visualforce

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

List the benefits of JavaScript Remoting.

1.) Allows you to run asynchronous actions by decoupling the page from the controller. 2.) Perform tasks on the page without having to reload the entire page. 3.) Alleviate view state issues while still running the page in the context of the user viewing the page. 4.) JavaScript Remoting is the most efficient way of calling the controller and passing data in from the page, because you can ensure that you are passing only the data that you need each time you make a call. 5.) Provides a more idiomatic approach to interacting with the Salesforce platform from JavaScript. 6.) Allows you to use familiar JavaScript practices and structures and makes leveraging other JavaScript frameworks and tool kits easier for front-end developers. 7.) JavaScript Remoting creates a more responsive experience that's ideal for mobile pages or any other page where your use case requires maximum efficiency and performance.

When should you use JavaScript Remoting?

1.) When developing mobile pages that require a more responsive experience 2.) When your use case requires maximum efficiency and performance. Because it's asynchronous, you can load only the initial page and the data that you need to display the page, and then lazily load additional data that might not be used on the page immediately. 3.) When you intend to leveraging other JavaScript frameworks and tool kits, making it easier for front-end developers to interact with the Salesforce platform using a more idiomatic approach from JavaScript.

Is JavaScript Remoting synchronous or asynchronous?

Asynchronous.

What is the best way to include JavaScript libraries (like jQuery) in your Visualforce pages?

Create a static resource, and then include the library by adding an <apex:includeScript> component to your page. For example: <apex:page> <apex:includeScript value="{!$Resource.jquery}"/> </apex:page>

JavaScript remoting is optimized for...

JavaScript Remoting is optimized for use on mobile pages and on pages that use third-party JavaScript libraries. It enables dynamic, interactive pages that feel more responsive than traditional Visualforce pages.

What is JavaScript Remoting?

JavaScript remoting is a tool that front-end developers can use to make an AJAX request from a Visualforce page directly to an Apex controller. JavaScript remoting allows you to run asynchronous actions by decoupling the page from the controller and perform tasks on the page without having to reload the entire page.

What is the best practice for using JavaScript in Visualforce pages?

Upload your JavaScript as a Static Resource and utilize the <apex:includeScript> tag to reference the script. For example: <apex:includeScript value="{!$Resource.MyJavascriptFile}"/>

What is the proper way to get the full DOM Id for a Visualforce component on the page in JavaScript?

Use the {!$Component.[ComponentIdAttribute]} merge field. For example: function beforeTextSave() { document.getElementById('{!$Component.msgpost}').value = myEditor.getEditorHTML(); } //where 'msgpost' is the Id value assigned to the Id attribute of the apex component.


Ensembles d'études connexes

EXAM 5 (without perfusion) - third semester

View Set

Ethical Hacking Essentials Complete Practice Test

View Set

cell and developmental quiz questions

View Set

Accounting 101: Chapter 1-3 Exam

View Set

MARK4265 - CRM Final Exam (Chapters 7-12)

View Set

Compensation Test 3 Chapter 8 Slides

View Set

Osmoregulation VS Osmoconformers

View Set

Anatomy & Physiology I Exam 1 Study

View Set

Prioritization, Delegation, Mentoring, and Staff Development

View Set

CHAPTER 6/7, Audit Chapter 25, Auditing Chapter 6, Flashcards, Five components of COSO Internal control framework (CRIME), Cases, ADVANCED AUDITING FINAL PREP, ASC Judgement, Week 2 - Case 4.4: Waste Management Inc., Flashcards

View Set