CSA Visualforce Pages 2 — Questions and Answers
Question 1: Which Visualforce component is used to display a standard Salesforce list view?
- <apex:pageBlock>
- <apex:listView> (Correct answer)
- <apex:dataTable>
- <apex:pageBlockTable>
Correct answer: <apex:listView>
<apex:listView> renders a standard Salesforce list view for a given object and list view name.
Question 2: What attribute on <apex:page> controls whether the standard Salesforce header is displayed?
- showHeader (Correct answer)
- standardHeader
- displayHeader
- includeHeader
Correct answer: showHeader
The showHeader attribute on <apex:page> (default true) determines whether the standard Salesforce page header appears.
Question 3: Which tag is used to iterate over a list of records in a Visualforce page?
- <apex:forEach>
- <apex:repeat> (Correct answer)
- <apex:iterate>
- <apex:loop>
Correct answer: <apex:repeat>
<apex:repeat> iterates over a collection of data, rendering its body for each item in the list.
Question 4: A Visualforce page must reference a controller. Which option is NOT a valid controller type?
- Standard Controller
- Custom Controller
- Controller Extension
- Trigger Controller (Correct answer)
Correct answer: Trigger Controller
Visualforce supports Standard Controllers, Custom Controllers, and Controller Extensions — there is no 'Trigger Controller' type.
Question 5: What is the maximum size of a Visualforce page response that can be returned to a browser?
- 5 MB
- 10 MB
- 15 MB
- 25 MB (Correct answer)
Correct answer: 25 MB
Visualforce pages have a maximum response size of 15 MB when returned to the browser.
Question 6: Which <apex:page> attribute binds the page to a specific standard Salesforce object controller?
- controller
- standardController (Correct answer)
- objectController
- recordController
Correct answer: standardController
The standardController attribute specifies which Salesforce object the standard controller manages, such as standardController="Account".
Question 7: How do you reference a custom label in a Visualforce page?
- {!Label.MyLabel}
- {!$CustomLabel.MyLabel} (Correct answer)
- {!CustomLabel.MyLabel}
- {!$Label.MyLabel}
Correct answer: {!$CustomLabel.MyLabel}
Custom labels in Visualforce are referenced using the global variable syntax {!$CustomLabel.LabelName}.
Which Visualforce component is used to display a standard Salesforce list view?