Visualforce Flashcards
(94 cards)
After a Visualforce page redirect, the next page doesn’t show expected object information. What is the reason?
After a redirect, the controller clears the context state.
What is the limit on how many records a Visualforce iteration component can iterate over?
1,000 records. This is increased to 10,000 records in read only mode.
Which Visualforce component renders a ul or ol element with li items comprising the rows?
<apex:dataList>
</apex:dataList>
When is a view state deleted? When is it maintained?
It is deleted if a new get request is made by the user. If the user is redirected to a page that uses the same controller and the same or a proper subset of controller extensions, a postback request is made. When a postback request is made, the viewstate is maintained.
When returning a PageReference, named myPage, what must you first do to redirect to the new page?
Set the redirect attribute to true using myPage.setRedirect(true).
True or false: A Visualforce page can be launched as a quick action.
True.
Which Visualforce components are required for you to send actions through forms?
<apex:commandButton />
or <apex:commandLink/>
True or false: if you provide a constructor, you can still access the default, no-argument constructor.
False.
What is the standard signature for for an action method?
Is public, returns a PageReference, and contains no arguments.
What is the syntax to return a reference to the current page?
ApexPages.currentPage();
True or false: if you don’t provide a constructor, Apex provides a default, no-argument constructor.
True.
A Visualforce page uses the standard list controller with recordSetVar=”{!contacts}”. What is the syntax to create an <apex:pageBlockTable> to loop through the records?</apex:pageBlockTable>
<apex:pageBlockTable> value="{!contacts}" var="ct"></apex:pageBlockTable>
Which component adds the complete record details to a Visualforce page?
<apex:detail></apex:detail>
What is the syntax to include a Javascript file saved as a static resource named “jQuery”?
<apex:includescript value="{! $Resource.jQuery }"/>
How do you set a Visualforce page to read only mode?
Set the readOnly attribute of the <apex:page>
tag to true.
What is the syntax to output a formatted version of a field named myField from an object named myObject?
<apex:outputField value="{! myObject.myField}" />
What happens if any fields or objects referenced in a SOQL SELECT query using WITH SECURITY_ENFORCED are inaccessible to the running user?
A System.QueryException is thrown.
Which Visualforce tag adds AJAX support to another component?
<apex:actionSupport>
True or false: DML methods can be used in getter methods.
False.
Which character is the formula language operator that concatenates strings?
The & character.
Which property sets the action on an <apex:commandButton></apex:commandButton> component?
action
Which three components are used to include static resources?
<apex:includeScript>
, <apex:stylesheet>
, and <apex:image>
.
True or false: a controller extension uses the extends keyword in its class definition.
False.
Which method adds a message (usually an error message) to a page?
ApexPages.addMessages(message);