Visualforce 38% Flashcards
What is a Visualforce Controller?
A set of instructions that specifies:
- User interaction with VF markup, such as clicking a button or link.
- Access to data that should be displayed in a page.
- Modifications to component behavior.
What is a standard controller?
A standard controller consist of the same functionality and logic that is used for a standard Salesforce page, I.E. standard Account controller.
What happens if you use the standard controller on a page and the user doesn’t have access to the object?
The page will display a insufficient privileges error.
What is a custom controller?
A class written in Apex that implements the logic for the page without using a standard controller.
True/False: custom controllers execute in system mode.
True.
Are without sharing as standard and so ignores any permissions based on the users profile.
It is possible to change this by using the with sharing keyword in the controller extension.
True/False: standard controller execute in system mode.
False. Standard controllers execute in user mode (with sharing).
What is a controller extension?
A controller extension uses all the functionality in a standard controller. The controller extension expands or modifies that functionality by adding new capabilities or replacing standard capabilities.
Why would you choose a controller extension over a custom controller?
With an extension you do not have to recreate everything that a standard controller does to tweak or extend its operation.
What are custom components?
A reusable component that can be embedded in more than one Visualforce page.
Why would you choose to create a custom component over page templates?
Components provide more power and flexibility because:
1. You can define attributes that can be passed in to each components, which can change the way the markup is displayed on the final page.
2. Components are displayed in the reference dialog alongside standard component descriptions.
Note, Templates are defined as pages.
In which 4 ways can you integrate Visualforce pages into your Force.com application.
- Custom tab
- Override standard tab
- Override standard buttons or links
- Embedded in a detail page layout
What are global variables?
Global variables can be used in Visualforce without a controller and are referenced by $. I.E. $User represents the current user record.
How do you access fields from a record that are not globally available?
Associate the page with a controller.
Controllers provide pages with the data and business logic that make your application run.
What are action methods?
Action methods perform logic or navigation when a page event occurs.
How are action methods called from page markup?
By using the ! notation in the action parameter of one of the action tags: commandButton, actionPoller, etc.