User Interface: 20% Flashcards
What is the recordSetVar used for?
The recordSetVar attribute puts a standard controller into “list” mode and sets a varaible which will contain the list of object records.
Please note, this is only available for standard controllers
What is the difference between outputText and outputField?
The outputField component works automatically with sObject fields, but doesn’t work at all with custom classes.
OutputText works with any value (but doesn’t automatically include the formatting of the field)
Which component can you use to customize the caption, headers and footers of a table?
apex:facet
Which two components can you use to provide a way to embed a standard list view of an object’s records
apex:enhancedList and apex:listViews
What can you use to perform partial page updates (without requiring you to implement any complex JavaScript logic)
Visualforce lets you use Ajax effects to allow partial page updates. The key element is identifying what needs to be dynamically updated, and then using the rerender attribute to dynamically update that region of the page
How can you identify a region on a Visualforce page for Dynamic updates
A common technique when using Ajax in Visualforce is to group and identify the region to be dynamically updated. The component is often used for this, together with an id attribute for identifying the region.
What is the difference between the quicksave() and save() methods for a Visualforce page?
Use the quicksave() method instead of the save() method to insert or update an existing record without redirecting the user to the new record
What is the difference between apex:pageMessages and apex:pageMessage components?
The apex:pageMessages component can be used to group and display the information, warning and error messages across all components in the page.
The apex:pageMessage component is used to create custom messages
How can you use a Template with Another Page?
The apex:composition component fetches the Visualforce template page, and the apex:define component fills the named holes in that template. You can create multiple pages that use the same component, and just vary the placeholder text.
What is the syntax to include one Visualforce Page within another?
By using the apex:include. This lets you duplicate the entire contents of another page, without providing any opportunity to make any changes as you do with templates
example &
What does Javascript remoting mean?
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 to perform tasks on the page without having to reload the entire page.
In addition, JavaScript remoting can help alleviate view state issues while still executing in the context of the user viewing the page. JavaScript remoting is the most efficient way of calling the controller and passing data in from the page, because you can ensure that you’re passing only the data that you need each time that you make a call.
What does a class need to do in order to be a controller extension?
An Apex classs needs to have a constructor that accepts a Visualforce controller as its only parameter.
What does the navigator.geolocation feature do?
It checks if the deivce can provide geolocation coordinates. When it runs the user will be prompted by their device , requesting permission to share their location
How can Apex be used with Visual Workflow?
A) To set the version of a Flow being run
B) To start a Flow automatically
C) To add custom styling to a Flow
D) To control access to a FLow
B) - To start a Flow automatically
What type of content can you include in Visualforce pages? A) Text B) HTML C) JavaScript D) Flash
You can include all 4 types of content on a VF page
Where do attributes to Visualforce tags appear A) On the line following the start tag B) In brackets, directly after the tag C) After the tag name in the start tag D) With the JavaScript event for the tag
C) - Attributes come directly after the tag name in the start tag
True or False: Action bindings refer to other Visualforce components
False. Action bindings refer to action methods in the controller
What is a list controller?
A list controller allows the creation of pages that display and act on a set of records, such as list pages, related lists and mass action pages
Standard list controllers provide additional pagination actions, such as navigating the first, last, next and previous records
You set the list controller by using the recordsetVar attribute
When using a standard list controller, what are the returned records sorted on?
Sorted on the first column of data even if that column is not listed.
Identify the true statement about data methods:
A) Data methods perform logic
B) Data methods include navigation actions
C) Data methods are used to interact with data stored in the database
C) Data methods are used to interact with data stored in the database
Which type of controller requires the developer to define all action methods? A) Standard controllers B) Custom controllers C) Controller extensions D) Both standard and custom controllers
B) - Custom controllers
Identify the true statement about controllers:
A) Only standard objects have an associated standard controller
B) Custom controllers provide access to standard Salesforce data and behaviour
C) You cannot use both standard and custom controllers on the same page
D) Controller extensions have a no-argument constructor
C) - You cannot use both standard and custom controllers on the same page
What is the View State?
View state is the space in server memory where the information necessary to maintain the state of the database between requests is saved
As the user continues to interact with the page, the page accesses the controller objects toe execute data and action methods. The view state is updated with the current state of the data set.
What is the shorthand for getter/setter blocks without requiring you to code them yourself?
public integer MyReadOnlyProp {get;}
public double MyReadWriteProp {get; set;}
public string MyWriteOnlyProp {set;}
What does apex:commandButton do?
Attaches the action to the button
What does apex:commandLink do?
Attaches the action to the link
What methods are available from the ApexPages.Message class?
getSeverity
getSummary
getDetail
getComponentLabel
Which overridden methods will action bindings in pages that use multiple controller extensions call?
They will call the methods in the first class in the list of extensions
Can custom controllers accept parameters?
No, custom controllers must use a no-argument constructor for the top-level class.