User Interface: 20% Flashcards

1
Q

What is the recordSetVar used for?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between outputText and outputField?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which component can you use to customize the caption, headers and footers of a table?

A

apex:facet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which two components can you use to provide a way to embed a standard list view of an object’s records

A

apex:enhancedList and apex:listViews

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What can you use to perform partial page updates (without requiring you to implement any complex JavaScript logic)

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can you identify a region on a Visualforce page for Dynamic updates

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between the quicksave() and save() methods for a Visualforce page?

A

Use the quicksave() method instead of the save() method to insert or update an existing record without redirecting the user to the new record

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between apex:pageMessages and apex:pageMessage components?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can you use a Template with Another Page?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the syntax to include one Visualforce Page within another?

A

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 &

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does Javascript remoting mean?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does a class need to do in order to be a controller extension?

A

An Apex classs needs to have a constructor that accepts a Visualforce controller as its only parameter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the navigator.geolocation feature do?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

B) - To start a Flow automatically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
What type of content can you include in Visualforce pages?
A) Text
B) HTML
C) JavaScript
D) Flash
A

You can include all 4 types of content on a VF page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
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
A

C) - Attributes come directly after the tag name in the start tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

True or False: Action bindings refer to other Visualforce components

A

False. Action bindings refer to action methods in the controller

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is a list controller?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

When using a standard list controller, what are the returned records sorted on?

A

Sorted on the first column of data even if that column is not listed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

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

A

C) Data methods are used to interact with data stored in the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q
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
A

B) - Custom controllers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

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

A

C) - You cannot use both standard and custom controllers on the same page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the View State?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the shorthand for getter/setter blocks without requiring you to code them yourself?

A

public integer MyReadOnlyProp {get;}
public double MyReadWriteProp {get; set;}
public string MyWriteOnlyProp {set;}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What does apex:commandButton do?

A

Attaches the action to the button

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What does apex:commandLink do?

A

Attaches the action to the link

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What methods are available from the ApexPages.Message class?

A

getSeverity
getSummary
getDetail
getComponentLabel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Which overridden methods will action bindings in pages that use multiple controller extensions call?

A

They will call the methods in the first class in the list of extensions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Can custom controllers accept parameters?

A

No, custom controllers must use a no-argument constructor for the top-level class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Identify the common feature in custom controller and controller extension?
A) Both leverage existing data and actions
B) Both allow custom code to be used
C) Both require a no-argument constructor
D) Both execute in the user mode by default

A

B) - Both allow custom code to be used

31
Q

User A has permission to run class x. Class x calls class y and class z. Identify the true statement about permissions

A) User A can run class x. However, User A will need additional permissions on classes y and z
B) User A will get an insufficient privileges error when class x calls class y
C) User A will be able to execute the code completely
D) User A will not be able to execute any class
A

C) Permissions are only checked at the top-level of Apex code. As long as User A has the permission to execute class x, all the code will execute

32
Q

What is the transient keyword used for?

A

The transient keyword is a way to minimize the view state across wizards with a lot of pages or data.

33
Q

What should you declare variables as so you can reduce the size of the view state and free up memory?

A

Declaring transient variables can reduce the size of the view state and free up memory

34
Q

What are some automatic transient Variables (Name 5)

A
Savepoints
PageReferences
XMLStream classes
Collections of objects
System classes
35
Q

True or False: All custom components require a custom component controller?

A

False: A custom component controller is only required when custom logic is needed to decide how to render the component

36
Q

Identify the effects of using the transient keyword
A) It reduces the size of the view state
B) It declares instance variables that can be saved
C) It frees up memory
D) It declares global variables

A

A and C

The transient keyword is used to reduce the size of the view state and free up memory

37
Q

True or False: Developers use multiple controllers to maintain the view state of the entire wizard

A

False. Developers use a single controller to maintain the view state of the entire wizard.

38
Q

How does the Lightning Components interact with Force.com?

A
  1. Component resoruces run on the client side
  2. Events handled by JavaScript make HTTP requests to Force.com (The App doesn’t wait for a response, as the call is asynchronous)
  3. Force.com invokes Apex server-side controller methods
  4. Force.com returns the result to JavaScript callback functions
39
Q

What value provider is used to reference the record’s field values in a Component Resource (when using the aura:attribute)

A

Use v. to reference the sObject fields of the record referenced by the aura:attribute

40
Q

You can use Visualforce to extend Salesforce1 for all of the following except: (pick one)
A) Adding a custom action to the action bar
B) Adding an item to the navigation menu
C) Adding an item to Setup
D) Adding related information to a record detail page

A

C) - You cannot use it to add an item to Setup

41
Q

Which of the following Salesforce1 app requirements would be most likely to push you in the direction of using programmatic tools like Visualforce
A) Governor limits
B) A need to use custom objects and fields to track data specific to your business
C) A need to support a complex business process with a highly customized user interface and click-through path
D) A need for full access to all data stored in Salesforce

A

C) - The need to support a complex business process with a highly customized user interface and click-through path

42
Q

Why are Remote Objects good for use with Salesforce1?

A

Remote objects does away with the view state that’s part of standard Visualforce.
Remote Objects is JavaScript based.

43
Q

Which Javascript code should be imported to seamlessly blend your custom visualforce page with the buil-in Salesforce1 features

A

The Publisher

‘/canvas/sdk/js/publisher.js’

44
Q

What is the Force.com Canvas SDK?

A

It is a suite of JavaScript libraries that provide simple ways to use existing Salesforce1 APIs (REST, SOAP, Chatter REST) to build better user experiences for your mobile users

45
Q

Name at least six user interface guidelines for building Visualforce pages running Salesforce1

A

Any of the following :)
- Design for small screens
- Use responsive design to automatically adapt the page layout to different screen sizes
- Design for touch interactions (avoid keyboard or mouse-centric UI)
- Limit keyboard input
- Use available device sensors (ex geolocation and camera)
Avoid VF components that mimic the full SFDC site (prefer plain HTML components)
- Prefer the JavaScript single-page application pattern over multi-page processes
- Use a JavaScript framework
- Use a CSS framework

46
Q

Name 5 Visualforce Components/Features you should avoid when developing for Salesforce1

A
  • Avoid structural components (ex: apex:pageBlock)
  • Avoid wide, non-wrapping components (especially: apex:detail, apex:enhancedList, apex:listViews, apex:relatedList
  • Avoid using apex:inlineEditSupport
  • Avoid using apex:inputField for date and lookup fields
  • PDF rendering isn’t supported for pages in Salesforce1
47
Q

Guidelines and best practices for creating apps for Salesforce1 include which of the following:
A) Include all of the features your users might need because they won’t be in the office to use their regular computer
B) make user interface elements like form fields and buttons smaller so that you can fit more on the screen at once
C) Avoid accessing device sensors like the camera because they trigger privacy confirmations that confuse users
D) Limit the amount of text users must enter because typing is harder on small devices.

A

D) - Limit the amount of text users enter because typing is harder on small devices

48
Q

Characteristics of responsive design include all of the following EXCEPT:
A) A user interface that changes to adapt to the screen size
B) Implemented using CSS
C) Requires separate web pages for different form factors
D) Implemented using HTML

A

C) Requires separate web pages for different form factors

49
Q

Which of the following tags would be best to use for a form element that allows users to enter a date for an individual record?
A) apex:detail
B) apex:input
C) apex:inputField
D) apex:inputText
E) apex:selectList (used with apex:selectOption or apex:selectOptions)

A

B) apex:input

50
Q

Which of the following descriptions about the Lightning Components framework is true?
A) It uses JavaScript on the client side and Apex on the server side
B) It uses events to communicate data between components
C) It uses a stateful client and stateless server architecture
D) All of the above

A

D) All of the above

51
Q

How is the Lightning Component framework different from Visualforce?
A) The framework can be used to build mobile apps only
B) The framework is client-side centric, while Visualforce relies on server calls
C) They are both useful in building components, but Visualforce has a simpler mark-up
D) None of the above

A

B) The framework is client-side centric, while Visualforce relies on server calls

52
Q

What can you build with the Lightning Components framework?
A) A standalone app
B) Components for the Salesforce1 app
C) Custom components that override and extend the Salesforce1 app
D) All of the above

A

D) All of the above

53
Q

What should your Lightning component implement to allow it to be added to the navigation menu in Salesforce1?

A

It should implement “force:appHostable”

54
Q

Explain what is the usage of the following Resources in a Component Bundle:

Component or Application (Sample.cmp or sample.app)

A

The only required resource in a bundle. Contains markup for the component or app. Each bundle contains only one component or app resource.

55
Q

Explain what is the usage of the following Resources in a Component Bundle:

CSS Styles (sample.css)

A

Styles for the component.

56
Q

Explain what is the usage of the following Resources in a Component Bundle:

Controller (sampleController.js)

A

Client-side controller methods to handle events in the component.

57
Q

Explain what is the usage of the following Resources in a Component Bundle:

Design (sample.design)

A

Required for components used in the Lightning App Builder, Lightning Pages, or Community Builder.

58
Q

Explain what is the usage of the following Resources in a Component Bundle:

Helper (sampleHelper.js)

A

JavaScript functions that can be called from any JavaScript code in a component’s bundle.

59
Q

Explain what is the usage of the following Resources in a Component Bundle:

Documentation (sample.auradoc)

A

A description, sample code, and one or multiple references to example components.

60
Q

Explain what is the usage of the following Resources in a Component Bundle:

Renderer (sampleRenderer.js)

A

Client-side renderer to override default rendering for a component.

61
Q

Explain what is the usage of the following Resources in a Component Bundle:

SVG (sample.svg)

A

Custom icon resource for components used in the Lightning App Builder or Community Builder.

62
Q

In a Lightning component, how do you load a set of CSS?

A

Specify a comma-separated list of resources in the styles attribute to load a set of CSS.

63
Q

In a Lightning component, what is the Loading Order of the CSS styles?

A

The styles are loaded in the order that they are listed

64
Q

In a Lightning component (or app), how are the values for attributes references

A

Using standard {!v.myAttribute} expression syntax.

65
Q

How is an attribute defined in a Lightning component or app?

A

using the aura:attribute tag which requires values for the name and type attributes (and the optional attributes are default, description, required)

66
Q

Name 2-4 Global value providers that can be used in a Lightning component

A

globalID (returns the global ID for a component)

$Browser: Returns information about the hardware and operating system of the browser accessing the application

$Label: Enables you to access labels stored outside your code

$Locale: returns information about the current users’s preferred locale

67
Q

What are some Lightning Events Best Practices? (Name between 2-4)

A
  1. Use Component Events whenever possible
  2. Separate Low-Level Events from Business Logic Events
  3. Dynamic Actions based on Component State
  4. Using a Dispatcher Component to Listen and Relay Events
68
Q

How can you control the number of records displayed on each page (for a list controller)?

A

Use a controller extension to set the pageSize

69
Q

What are differences between JavaScript Remoting and apex:actionFunction?

A

Apex:actionFunction tag:

  • lets you specify rerender targets
  • submits the form
  • doesn’t require you to write any JavaScript

JavaScript remoting:

  • lets you pass parameters
  • provides a callback
  • requires you to write some JavaScript
70
Q

What is the difference between JavaScript Remoting and Remote Objects?

A

Visualforce Remote Objects:

  • Makes basic “CURD” object access easy
  • Doesn’t require any Apex code
  • Supports minimal server-side application logic
  • doesn’t provide automatic relationship traversals; you must look up related objects yourself

JavaScript Remoting:

  • Requires both JavaScript and Apex code
  • Supports complex server-side application logic
  • Handles complex object relationships better
  • Uses network connections (even) more efficiently
71
Q

How do you declare a remote method in Apex?

A
  • In the controller, the method declaration is preceded with the @RemoteAction
  • They must be static and either global or public
  • Method overloading isn’t possible
72
Q

What are the 3 steps to add Lightning components to your visualforce pages?

A

There are three steps to add Lightning components to a Visualforce page.

  1. Add the apex:includeLightning component to your Visualforce page.
  2. Reference a Lightning app that declares your component dependencies with $Lightning.use().
  3. Write a function that creates the component on the page with $Lightning.createComponent().
73
Q

Which syntax will you use to reference and external CSS static resource (in Lightning)

A

Use ltng:require in your .cmp or .app markup

ltng:require styles=”/resource/resourceName”/

74
Q

How do you expose apex methods to allow client and server side access (from Lightning components)

A

use the @AuraEnabled annotation.
The methods must be static and marked public or global
Non Static methods are not supported