Visualforce Flashcards
What is Visualforce?
Visualforce is a programmatic user interface framework that is used to build complex interfaces that are native to the Salesforce platform
- has it’s own markup language
- can include HTML w/in Visualforce page
- offers standard components (visualforce component library)
- uses server-side Apex controllers to interact with database
How is Visualforce framework able to interact with a database?
- the Visualforce framework makes use of server-side Apex controllers to be able to interact with the database
What static resources?
they are files that are uploaded to and stored within our orgs so that we can reference them and use them throughout the platform
What is the syntax for referencing static resource?
single file
{!$Resource.resourceName}
archived file
{!URLFOR($Resource.archiveName, ‘fileName’)}
What are custom labels?
custom labels can be used in Visualforce, Apex, and in Lightning components
- they allow us to translate a message into the language in the viewing user’s settings, provided that we’ve added support for that language
How to reference Custom Labels?
Reference in Apex by using the System.Label class:
System.Label.Custom_Label_API_Name
Reference in Visualforce by using expression syntax and the $Label global variables:
{!$Label.Custom_Label_API_Name}
What are the different types of Apex controllers?
- standard controller
- standard set controller (i.e. standard list controller)
- controller extension
- custom controller
What is expression syntax?
- expression syntax is used to notify the framework that the value we’re providing is a reference to something else and not meant to be interpreted literally
- syntax: {!referencedValue}
- used w/ action and data binding
What is action binding?
- action binding is the act of coupling a method inside a Visualforce page’s Apex controller to an event on the page through the syntax {!methodName}
What is data binding?
- data binding is act of coupling a variable in the Apex controller to a value on our Visualforce page through the format {!variableName}
What is a Standard Controller?
- a standard controller is a pre-written, Salesforce-made Apex class that provides functionality for our Visualforce pages (similar to lightning data services
- automatically created for custom objects
- same functionality as lightning record pages (save,delete… record)
How do you declare a standardController?
- declared by setting standardController attribute in the opening [apex:page] tag, passing the API name of the object that we want to use the standard controller of
[apex:page standardController=”Account”]{!account.Name}[/apex:page]
What is a Standard Set Controller
- while standard controllers only allow us to interact with one record at a time, the prebuilt standard set controllers allow us to work with groups of records at a single time
- Visualforce pages that use the standard set controller default to displaying at most 20 records per page
- contains methods for pagination
How do you declare Standard Set Controller?
- to declare the use of a standard set controller in a Visualforce page, we’ll set the standardController and recordSetVar attributes in the opening
- standardController takes the API name of the object we’re working with
- recordSetVar takes a variable name that we’ll use to reference the list of records throughout the remainder of our Visualforce page
What is pagination?
- pagination is the act of dividing records into multiple pages so that the user isn’t overwhelmed with a lengthy table