SlideShare a Scribd company logo
Force.com User Interface 
Sujit Kumar 
Zenolocity LLC © 2012 - 2024
Overview 
• MVC Architecture 
• Hello World Example 
• Controllers 
• View Components 
• Native UI 
• Security
MVC Architecture 
• View or Presentation – HTML with VisualForce 
specific XML tags. 
• Controller – Apex classes with business logic. 
• Model (data read and write access) is part of 
the Controller.
Visual Force MVC Architecture
Controllers 
• Interaction of the controller with the UI is via 
the variables and action methods. 
• Action methods perform the processing work 
on behalf of the user. Wired up to buttons, 
links, and even asynchronous events on the 
user interface. 
• Variables exposed to the presentation layer 
via getters and setters.
Types of Controllers 
• Standard Controllers - replicate the behavior 
of the native UI, such as editing and creating 
records, but allow customization without 
code. 
• Controllers with Extensions – classes written 
in Apex that add extend or override behavior 
of standard controllers. 
• Custom Controllers – implement from scratch.
VisualForce Page 
• Defines the appearance of the UI using a mixture 
of standard HTML and VisualForce-specific XML 
markup. 
• The XML markup is used to add view components 
to the page. 
• View components bind the controller to the page, 
defining how data and user actions are to be 
rendered in the user interface. 
• Force.com provides a standard set of view 
components to support common HTML UI 
patterns and supports user-defined components.
Interaction between Page and 
Controller 
• In the MVC picture, the arrows between the page 
and the controller represent expressions. 
• Expressions are embedded in view components 
to allow the page to reference methods in the 
controller or in system classes such as UserInfo. 
• Expressions in Visualforce use the same language 
as formula fields in the database, with a special 
prefix and suffix added. 
• For example, {!save} is an expression that invokes 
the save method of the controller.
Hello World Page 
<apex:page controller="MyPageController"> 
<apex:form> 
Your name: <apex:inputText value="{!name}" /> 
<apex:outputText value="{!message}" /> 
<apex:commandButton action="{!hello}" 
value="Say Hi" /> 
</apex:form> 
</apex:page>
Hello World MyPageController 
public class MyPageController { 
public String name { get; set; } 
public String message { get; private set; } 
public PageReference hello() { 
message = 'Hello, ' + name; 
return null; 
} 
}
Standard Controllers 
• Every database object, both standard and 
custom, has a standard controller. 
• Its name is simply the name of the object. 
• No Apex code exists for a standard controller. 
• The controller implementation is already 
provided by Force.com. 
• By default, the standard controller operates on a 
single record at a time. It receives this record 
from the id parameter in the URL.
Expressions for Standard Controller 
Following expressions are available in a page that uses a standard controller. 
Data: {!id} is the unique identifier of the current record, and {!object} is the 
current record itself, where object is the lowercase name of the object. All 
fields of the object are automatically available, including related child objects 
but not parent objects. 
Navigation: {!cancel} navigates to the cancel page, {!edit} to the standard edit 
page, and {!view} to the standard view page. 
Action and Navigation: {!delete} deletes the current record and navigates to 
the standard delete page, and {!save} saves the current record and refreshes 
the page. 
Action Only: {!quicksave} saves the current record without navigation.
Standard Set Controller 
• Operates on a list of records rather than a 
single record. The list is produced by executing 
a view, a user-defined set of column names, 
filter criteria, and sort criteria for an object. 
<apex:page standardController="Proj__c 
recordSetVar="projects"> 
<apex:repeat value="{!projects}" var="p"> 
{!p.Name}<br /> 
</apex:repeat> 
</apex:page>
Standard Set Controller 
• The recordSetVar indicates to Force.com that 
the standard set controller should be used. 
• Can work with up to 10,000 records at a time. 
• Supports pagination with a variable page size. 
It also supports multiple selection and actions 
on a selected set of records.
• Data: The variable name you set in recordSetVar is bound to the current list of 
records, {!selected} is an array of SObjects that are selected, {!resultsSize} sets or 
gets the number of records currently displayed, and {!completeResult} is a Boolean 
containing false if more than 10,000 records exist. 
• Pagination: Navigate across multiple pages of data using the {!first}, {!last}, {!next}, 
and {!previous} actions. {!pageNumber} sets or gets the current page number, and 
{!pageSize} sets or gets the number of records in a page. {!hasPrevious} returns true 
if a previous page exists, {!hasNext} returns true if a subsequent page exists. 
• Filters: {!filterId} is the unique identifier of the currently selected filter (list view), 
and {!listViewOptions} is an array of SelectOption objects containing the names and 
identifiers of the available list views. 
• Navigation: {!cancel} navigates to the cancel page, and {!edit} to the standard edit 
page. 
• Action and Navigation: {!delete} deletes the current record and navigates to the 
standard delete page, and {!save} saves the current record and refreshes the page. 
• Action Only: {!quicksave} saves the current record without navigation.
Controller Extensions 
• Extends or Overrides the behavior of a Standard or a Custom 
Controller. 
• Primarily used to integrate Visualforce more tightly with the native 
user interface. Many features of Visualforce integration such as 
overriding standard buttons are not supported for pages that use 
custom controllers. 
• Custom controllers can be easily retrofitted to become controller 
extensions. 
• Multiple extensions can be used in a single page, enabling a large 
monolithic controller to be divided into smaller controllers by 
behavior, where some pages might use only a subset of the 
behaviors.
Controller Extensions (contd…) 
• A controller extension is any Apex class containing a 
constructor that takes a single argument of type 
ApexPages.StandardController or 
CustomControllerName, where CustomControllerName 
is the name of a custom controller you want to extend. 
• Multiple controller extensions can be defined for a 
single page through a comma-separated list. This 
allows for overrides of methods with the same name. 
• Overrides are defined by whichever methods are 
defined in the “leftmost” extension, or, the extension 
that is first in the comma-separated list.
Example: Controller Extensions 
• Controller with Extensions 
public class MyPageController { 
private ApexPages.StandardController controller; 
public MyPageController(ApexPages.StandardController controller) { 
this.controller = controller; 
} 
public PageReference doSomething() { return null; } 
} 
• Page Using Sample Controller Extension 
<apex:page standardController="Resource__c“ 
extensions="MyPageController"> 
<apex:form> 
<apex:commandButton action="{!doSomething}" 
value="Do Something" /> 
</apex:form> 
</apex:page>
Custom Controllers 
• Provide complete control over the behavior of a 
page with no default implementation. 
• Simply an Apex class designed to be bound to a 
Visualforce page. No new syntax to learn. 
• Involves defining the data to make available to 
the page and the actions that the page can 
invoke. 
• Page Components use expressions to bind data 
exposed in the Controller. This binding is by 
reference, so data can be modified in the page or 
the Controller.
Example Custom Controller 
public class MyPageController { 
public Proj__c proj { get; private set; } 
public MyPageController() { 
proj = [ SELECT Name, Account__r.BillingCity 
FROM Proj__c 
WHERE Name = 'Tim Barr' LIMIT 1 ]; 
} 
}
Expression Language 
• Expression language allows traversal of an object 
through dot notation, so providing separate getters 
and setters for every field in a database record, for 
example, is not necessary. Expose the object itself and 
use dot notation to access its fields. 
• you can combine expressions to form more complex 
expressions. The expression {!isVisible && isEditable} 
invokes both the getIsVisible and getIsEditable 
methods on the controller and evaluates to true if they 
are both true. 
• Conditional expressions are also supported.
Action Methods 
• Actions on a page are wired up to action methods in the controller, again 
by expression language. 
• Action methods are public, non-static controller methods. 
• Return a PageReference object or null. If null, the current page is 
refreshed. If not, the PageReference is used to determine the location of 
the new page. 
• Use the setRedirect method on a PageReference. A redirect updates the 
browser’s URL, resets the view state and prevents problems with the 
browser’s reload button. 
• Perform custom business logic, like using DML methods to insert a record 
to the database.
View Components 
• View components work with the controller to 
define the appearance and behavior of a 
Visualforce user interface. 
• They connect variables in the controller to input 
and output elements such as text boxes and 
labels, and methods in the controller to action-oriented 
elements such as buttons and links. 
• Force.com provides a library of standard view 
components to support common Web user 
interface design patterns.
Types of View Components 
• Data Components – move data in/out of the controller 
using HTML elements. 
• Action Components - invoke methods on the controller, 
updating the view state and refreshing the page or 
navigating to a new page. 
• Primitive Components – similar syntax to HTML elements. 
• Force.com Styled Components – allow pages to inherit the 
style of the native UI. 
• Force.com UI Components - – allow pages to inherit the 
style & behavior of the native UI – list Views, enhanced List 
Views, related List views, detail views. 
• Custom Components
View Components Basics 
• View components are embedded in a Visualforce page 
using XML markup. 
• Every user interface page must begin with the page 
component. 
• All Visualforce components must be declared within 
the page component. 
• The rendered attribute, present on most components 
allows conditional rendering of its HTML. It is a 
boolean value that indicates whether the component is 
included in the page. Setting rendered to false does not 
hide the component using CSS. It omits it entirely from 
the rendered page.
Example of a View Component 
• The XML markup of a view component 
consists of three parts: the component name, 
an optional set of attributes, and an optional 
component body. 
<apex:dataList value="{!resources}" var="resource"> 
<b>{!resource.Name}</b> 
</apex:dataList>
Page Definition 
• Every Visualforce user interface page must 
begin with the page component. 
• Connect the page to a controller and 
optionally override the global appearance of 
the page. 
• Requires either a standard (standardController 
attribute) or a custom controller (controller 
attribute) or a controller extension (via the 
extensions attribute).
Page Definition Style 
• By default, pages are styled consistently with 
the Force.com native UI. 
• include its stylesheet, sidebar, and header 
region containing application tabs, banner, 
and drop-down list of applications. 
• Override this behavior by setting the 
standardStylesheets, sidebar, and showHeader 
Boolean attributes.
Data Components 
• Allow DB fields and records to be manipulated within a Visualforce 
page. 3 Types: 
• Metadata-Aware Components: The HTML rendered by these smart 
components varies based on the definition of the field. These 
components are valid only when bound to database objects. 
• Primitive Data Components: If field data is contained in a variable 
in Apex code rather than a database object, use primitive data 
components to render input and output HTML elements bound to 
their values. 
• Repeating Components: If you have a list of any type of object, you 
can iterate over it with a repeating component to render its 
contents.
Metadata-Aware Components 
• 2 components: one for input (inputField) and 
one for output (outputField). 
• inputField must be within a Form component. 
• For inputField, the html displayed depends on 
the database field it is bound to. 
• The outputField formats the value of a field 
using the correct pattern for that field’s data 
type.
Primitive Data Components 
• Add Visualforce functionality to standard HTML 
tags. 
• Use these components when you are working 
with data that is not contained in a database 
object or when the standard Visualforce 
rendering or behavior is not desirable. 
• Except outputLabel, all components listed in the 
table must be contained in a form component or 
else compilation fails. 
• Examples: inputText, selectList, selectRadio, etc.
Repeating Data Components 
• Bound to a list of values, iterate over them, 
rendering the component body for each child 
in the collection. 
• Attributes: value (collection) and var (current 
child). 
• 3 types: dataList (HTML List), dataTable (HTML 
table) and repeat (no HTML, custom HTML 
provided by developer).
Action Components 
• Allow the page to invoke a method on the Controller. 
The method on the controller typically issues a DML & 
then refreshes the current page or navigates to a new 
page. 
• Setter methods on Controller used to inject data from 
the page. 
• 2 basic action components: commandButton and 
commandLink. 
• Valid only inside a Form Component. 
• action attribute specifies the name of the controller 
method to invoke or the URL of a new page to navigate 
to.
Primitive Components 
• Very similar to standard HTML tags but PCs can do 
server side conditional rendering which standard HTML 
cannot. 
• Visualforce provides the rendered attribute, that 
improves the performance of pages by conditionally 
rendering markup based on the state of the controller. 
• Additional Primitive Components: includeScript and 
stylesheet. These 2 do not have the rendered attribute, 
have a val attribute that specifies the URL of the script 
or style sheet to load. More efficient & ensure scripts 
and stylesheets are not duplicated on the page.
Force.com Styled Components 
• Force.com’s native UI makes heavy use of CSS and 
JavaScript within its Web pages to provide a 
consistent look-and-feel across the platform. 
• Many Visualforce components deliver this same 
styling to developers, without requiring any 
knowledge of Force.com’s CSS or other 
implementation details. 
• 5 Categories based on their function: Page 
Structure, Action Containers, Table, Paging 
Components, Notifications.
Force.com Styled Components - 
Categories 
• Page Structure: sectionHeader, pageBlock, pageBlockSection, and 
pageBlockSectionItem are the native structural elements used by 
Force.com to organize a page into a hierarchy of clearly identifiable 
sections, subsections, and sets of label/field pairs. 
• Action Containers: pageBlockButtons and toolbar / toolbarGroup organize 
a series of buttons or links for performing actions on the page. 
• Table: pageBlockTable is used like a dataTable but renders rows and 
columns in the Force.com native style. 
• Paging Components: panelBar / panelBarItem and tab / tabPanel group 
components into pages that can be dynamically shown and hidden. 
• Notifications: pageMessages displays errors and information.
Force.com UI Components 
• listViews: rendered by Force.com on the list page 
of an object tab when the Enable Enhanced Lists 
option is disabled for the organization. 
• enhancedList: consists of a drop-down list of view 
names and a table of records returned by 
executing the view. 
• relatedList: renders the records of any one of an 
object’s child objects. 
• detail: provides a subset of the native user 
interface’s detail page for an object.
listViews Component 
• Capability to create and edit list views, as well 
as execute them and render their records. 
• The only required attribute of listViews is 
type, which binds a database object type to 
the component.
enhancedList Component 
• Enhanced version of the listViews component. 
• Same functionality but also includes drag-and-drop 
re-orderable columns, sortable columns, 
and results pagination with dynamic page 
sizes. 
• Appears in the native UI only when Enable 
Enhanced Lists is enabled for the organization. 
• Required attributes: height and (type of the 
DB object or the listId of the listView).
relatedList Component 
• Renders a list of paginated child records. 
• Allows related records to be edited, deleted, and 
created, depending on the object permissions of 
the current user. 
• Required attributes: list (the name of the child 
relationship to be rendered in the list) and 
subject (an expression language reference to the 
parent record on the controller , defaults to the id 
parameter of the page if not provided). 
• Both MDRs and LRs are supported.
Detail Component 
• Replicates the functionality of the native UI on 
the detail page of a record. It respects the page 
layout of the record, including page layouts 
defined per record type. 
• It also supports inline editing for the edit mode of 
an object. 
• Requires a subject or it attempts to read a record 
identifier from the page’s id URL parameter. 
• By default, all related lists are rendered below the 
detail section unless the relatedList parameter is 
set to false.
Extensible UI Elements 
• The following are extensible using Visualforce. 
• Standard Pages 
• Standard Buttons 
• Page Layouts 
• Custom Buttons and Links 
• Custom Tabs
Extensible UI Elements 
• Standard Pages: default UI for maintaining the records. 
Can be overridden with Custom Visualforce pages. 
• Standard Buttons: navigate the user to standard pages. 
Can be remapped to navigate the user to custom 
pages. 
• Custom Buttons: appear at the top and bottom of 
standard pages. 
• Custom Links: appear in a detail page. 
• Custom Tabs: added to an application and appear at 
the top under the application banner. A Visualforce 
page can be configured as a custom tab.
Standard Pages 
• 4 standard pages for working with DB records. 
• Tab Page: appears when a custom object tab 
is clicked. Shows recently accessed records. 
• List Page: shows records in a list. Reach this 
page by clicking Go button on the tab page. 
• View Page: read-only view of a single record 
and it’s related records. 
• Edit Page: same layout as the view page but 
lets you change and save the record.
Overriding Standard Pages 
• Tab, view, and edit pages can be overridden 
only with Visualforce pages that use a 
standard, single record controller. 
• The list page must use a standard set 
controller. 
• Controller extensions are supported in all 
pages.
Overriding Standard Buttons 
• 4 buttons can be overridden. 
• New – navigates to edit page of a new record. 
• Delete – page navigated to after record is 
deleted. Default is the list page. 
• Clone -> to edit page of a duplicated record. 
• Accept – applies to records owned by a queue 
rather than a single user. Enables to transfer 
ownership to the user. Appears on a list page 
when displaying records owned by a queue.
Overriding Page Layouts 
• A Visualforce page can be embedded in an 
object’s page layout alongside its fields. 
• For Visualforce pages to appear in the page 
layout editor, they cannot already be in use by 
a tab and must use a standard single record 
controller, with or without extensions.
Custom Buttons and Links 
• They can navigate to any VF page. 
• Can be added to page layouts. 
• Need to be defined on the database object. 
• Go to App Setup area, click Create -> Objects, 
and then click the object. Scroll to the Custom 
Buttons and Links area and click the New 
button. 
• Can be added to the detail page layout or 
related list page layout.
Custom Tab 
• You can configure any Visualforce page as a 
new tab in the Force.com native UI. 
• To add a new Visualforce tab, go to the App 
Setup area and click Create ->Tabs. 
• Click the New button in the Visualforce Tabs 
section to create a tab. 
• Select a Visualforce page, select a tab label 
and style, set tab visibility on profiles and 
applications, and click Save.
Debugging and Tuning 
• Look at the System log first. 
• Add System.debug statements in controller. 
• Trial & Error – comment out portions of VF page 
till you can narrow the error. 
• Use Firebug to find client side errors. 
• View State is limited to 128k. View State contains 
the local variables in the controller. 
• Reduce local variables and/or mark some of them 
as transient.
Visualforce Security 
• Obeys the object and field level security 
configured in profiles. 
• Access to the page itself is granted by user’s 
profile. 
• Record security handled by controller through 
special keywords in Apex.
Developer Notes – VF Security 
• When developing a controller, check that the 
SOQL, SOSL, and DML operations are fully 
compatible with the set of profiles expected to 
use the page. 
• A developer has full visibility to every object and 
field, but do not assume that other users have 
the same level of access. Test the Visualforce 
pages by logging in as a test user or cycling 
through profiles on a single test user. 
• Write unit tests that run under the privileges of a 
specific user using the System.runAs method.
Record Level Security 
• Standard controllers always honor the record-level 
security of the current user. 
• Record sharing rules are ignored by code in 
custom controllers. These controllers run in a 
system context, like a trigger. 
• Record sharing rules are honored by the 
methods of standard controllers that have 
extensions defined, but the code in an 
extension class itself still runs in system mode.
Record Sharing – Custom Controllers 
• Two security modes are available: with 
sharing and without sharing. 
• Without Sharing is default mode. 
• Example of with sharing: 
public with sharing class MyController { 
// the code in this controller honors record sharing rules 
}
Page Level Security 
• Pages must be explicitly enabled for each profile that 
requires access. If this is not done, users will receive an 
error page titled Insufficient Privileges when attempting to 
view the page. 
• To grant a profile access to a page, go to the Administration 
Setup and click Manage Users ➝ Profiles. Scroll to the 
Enabled Visualforce Page Access section and click the Edit 
button. Select pages from the Available Visualforce Pages 
list and click the Add button to add them to the Enabled 
Visualforce Pages list. Click Save. 
• Users with the Customize Application permission can 
access all Visualforce pages in the organization.
Uncaught Exceptions 
• In triggers, good formatted message is shown. 
• In VF page, generic error page whose appearance 
cannot be controlled or customized. 
• Goals of error handling in VF pages – avoid 
uncaught exceptions. 
• Place a try/catch block around every action 
method, or at least those that perform SOSL, 
SOQL, or DML operations. 
• Catch all exceptions and rollback the transaction 
using a savepoint in the controller method.
Error Communication 
• VF provides page components and corresponding data objects for 
communicating errors to the user in a consistent way. 
• The page components are messages and pageMessages, which 
display the page-level errors returned by a controller. 
• These components are placed on pages, typically at the top, and 
render the ApexPages.Message objects added to the page. 
• Message objects contain a message and optional severity. 
• Severity is used to style the message when displayed in the 
pageMessages component and can also be filtered on in test 
methods. 
• Example of code to add an error-severity message to the page. To 
be visible, it must be rendered by a messages or pageMessages 
component. 
ApexPages.addMessage(new ApexPages.Message( 
ApexPages.Severity.ERROR, 'Something went wrong'));
Governor Limits 
• Apply during execution of user-initiated actions and are 
not cumulative. When an action is complete, the 
governor limits reset. 
• Heap => 3MB. 
• Apex code => 200,000 lines of code executed. 
• SOQL => 100 queries. 
• Records from SOQL => 50,000 records cumulatively for 
all SOQL queries. 
• DML => 150 DML statements. 
• Records in DML => 10,000 records cumulatively for all 
DML statements.

More Related Content

What's hot

Templates
TemplatesTemplates
Templatessoon
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauSpiffy
 
ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and Skinning
George Estebe
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
Fioriela Bego
 
Oracle ADF 11g Skinning Tutorial
Oracle ADF 11g Skinning TutorialOracle ADF 11g Skinning Tutorial
Oracle ADF 11g Skinning Tutorial
Rakesh Gujjarlapudi
 
Oracle ADF Case Study
Oracle ADF Case StudyOracle ADF Case Study
Oracle ADF Case Study
Jean-Marc Desvaux
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
SPTechCon
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
Rene Modery
 
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingSharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
John Calvert
 
Oracle ADF 11g Tutorial
Oracle ADF 11g TutorialOracle ADF 11g Tutorial
Oracle ADF 11g Tutorial
Rakesh Gujjarlapudi
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Rob Windsor
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.netBhumivaghasiya
 
Custom Controllers and Controller Extensions
Custom Controllers and Controller Extensions Custom Controllers and Controller Extensions
Custom Controllers and Controller Extensions
Mohammed Safwat Abu Kwaik
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvcGuo Albert
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
Amelina Ahmeti
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
Rob Windsor
 

What's hot (20)

Templates
TemplatesTemplates
Templates
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and Skinning
 
ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!ASP.NET - Building Web Application..in the right way!
ASP.NET - Building Web Application..in the right way!
 
Oracle ADF 11g Skinning Tutorial
Oracle ADF 11g Skinning TutorialOracle ADF 11g Skinning Tutorial
Oracle ADF 11g Skinning Tutorial
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
Oracle ADF Case Study
Oracle ADF Case StudyOracle ADF Case Study
Oracle ADF Case Study
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
 
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingSharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
 
Oracle ADF 11g Tutorial
Oracle ADF 11g TutorialOracle ADF 11g Tutorial
Oracle ADF 11g Tutorial
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 
Custom Controllers and Controller Extensions
Custom Controllers and Controller Extensions Custom Controllers and Controller Extensions
Custom Controllers and Controller Extensions
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvc
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 

Similar to SFDC UI - Introduction to Visualforce

Standard Controllers
Standard Controllers Standard Controllers
Standard Controllers
Mohammed Safwat Abu Kwaik
 
Coding the Salesforce1 Platform User Interface
Coding the Salesforce1 Platform User InterfaceCoding the Salesforce1 Platform User Interface
Coding the Salesforce1 Platform User Interface
Keir Bowden
 
SFDC UI - Advanced Visualforce
SFDC UI - Advanced VisualforceSFDC UI - Advanced Visualforce
SFDC UI - Advanced Visualforce
Sujit Kumar
 
Asp PPT (.NET )
Asp PPT (.NET )Asp PPT (.NET )
Asp PPT (.NET )
Ankit Gupta
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
Fajar Baskoro
 
Standard List Controllers
Standard List Controllers Standard List Controllers
Standard List Controllers
Mohammed Safwat Abu Kwaik
 
Introduction to visualforce
Introduction to visualforceIntroduction to visualforce
Introduction to visualforce
Rinku Saini
 
ASP.NET Lecture 3
ASP.NET Lecture 3ASP.NET Lecture 3
ASP.NET Lecture 3
Julie Iskander
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVCSagar Kamate
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance TopicsAli Taki
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
Gigin Krishnan
 
Parallelminds.web partdemo1
Parallelminds.web partdemo1Parallelminds.web partdemo1
Parallelminds.web partdemo1
parallelminder
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
Julie Iskander
 
Getting a Quick Start with Visualforce
Getting a Quick Start with Visualforce Getting a Quick Start with Visualforce
Getting a Quick Start with Visualforce
Mohammed Safwat Abu Kwaik
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
Vivek chan
 

Similar to SFDC UI - Introduction to Visualforce (20)

Visualforce
VisualforceVisualforce
Visualforce
 
Standard Controllers
Standard Controllers Standard Controllers
Standard Controllers
 
Coding the Salesforce1 Platform User Interface
Coding the Salesforce1 Platform User InterfaceCoding the Salesforce1 Platform User Interface
Coding the Salesforce1 Platform User Interface
 
SFDC UI - Advanced Visualforce
SFDC UI - Advanced VisualforceSFDC UI - Advanced Visualforce
SFDC UI - Advanced Visualforce
 
Asp PPT (.NET )
Asp PPT (.NET )Asp PPT (.NET )
Asp PPT (.NET )
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
 
Standard List Controllers
Standard List Controllers Standard List Controllers
Standard List Controllers
 
Introduction to visualforce
Introduction to visualforceIntroduction to visualforce
Introduction to visualforce
 
ASP.NET Lecture 3
ASP.NET Lecture 3ASP.NET Lecture 3
ASP.NET Lecture 3
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
Session 1
Session 1Session 1
Session 1
 
Mvc
MvcMvc
Mvc
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVC
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
 
Standard control in asp.net
Standard control in asp.netStandard control in asp.net
Standard control in asp.net
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
 
Parallelminds.web partdemo1
Parallelminds.web partdemo1Parallelminds.web partdemo1
Parallelminds.web partdemo1
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
Getting a Quick Start with Visualforce
Getting a Quick Start with Visualforce Getting a Quick Start with Visualforce
Getting a Quick Start with Visualforce
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
 

More from Sujit Kumar

Introduction to OOP with java
Introduction to OOP with javaIntroduction to OOP with java
Introduction to OOP with java
Sujit Kumar
 
SFDC Database Basics
SFDC Database BasicsSFDC Database Basics
SFDC Database Basics
Sujit Kumar
 
SFDC Database Security
SFDC Database SecuritySFDC Database Security
SFDC Database Security
Sujit Kumar
 
SFDC Social Applications
SFDC Social ApplicationsSFDC Social Applications
SFDC Social Applications
Sujit Kumar
 
SFDC Other Platform Features
SFDC Other Platform FeaturesSFDC Other Platform Features
SFDC Other Platform Features
Sujit Kumar
 
SFDC Outbound Integrations
SFDC Outbound IntegrationsSFDC Outbound Integrations
SFDC Outbound Integrations
Sujit Kumar
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound Integrations
Sujit Kumar
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
Sujit Kumar
 
SFDC Batch Apex
SFDC Batch ApexSFDC Batch Apex
SFDC Batch Apex
Sujit Kumar
 
SFDC Data Loader
SFDC Data LoaderSFDC Data Loader
SFDC Data Loader
Sujit Kumar
 
SFDC Advanced Apex
SFDC Advanced Apex SFDC Advanced Apex
SFDC Advanced Apex
Sujit Kumar
 
SFDC Introduction to Apex
SFDC Introduction to ApexSFDC Introduction to Apex
SFDC Introduction to Apex
Sujit Kumar
 
SFDC Database Additional Features
SFDC Database Additional FeaturesSFDC Database Additional Features
SFDC Database Additional Features
Sujit Kumar
 
Introduction to SalesForce
Introduction to SalesForceIntroduction to SalesForce
Introduction to SalesForce
Sujit Kumar
 
More about java strings - Immutability and String Pool
More about java strings - Immutability and String PoolMore about java strings - Immutability and String Pool
More about java strings - Immutability and String Pool
Sujit Kumar
 
Hibernate First and Second level caches
Hibernate First and Second level cachesHibernate First and Second level caches
Hibernate First and Second level caches
Sujit Kumar
 
Java equals hashCode Contract
Java equals hashCode ContractJava equals hashCode Contract
Java equals hashCode ContractSujit Kumar
 
Java Comparable and Comparator
Java Comparable and ComparatorJava Comparable and Comparator
Java Comparable and ComparatorSujit Kumar
 
Java build tools
Java build toolsJava build tools
Java build toolsSujit Kumar
 
Java Web services
Java Web servicesJava Web services
Java Web servicesSujit Kumar
 

More from Sujit Kumar (20)

Introduction to OOP with java
Introduction to OOP with javaIntroduction to OOP with java
Introduction to OOP with java
 
SFDC Database Basics
SFDC Database BasicsSFDC Database Basics
SFDC Database Basics
 
SFDC Database Security
SFDC Database SecuritySFDC Database Security
SFDC Database Security
 
SFDC Social Applications
SFDC Social ApplicationsSFDC Social Applications
SFDC Social Applications
 
SFDC Other Platform Features
SFDC Other Platform FeaturesSFDC Other Platform Features
SFDC Other Platform Features
 
SFDC Outbound Integrations
SFDC Outbound IntegrationsSFDC Outbound Integrations
SFDC Outbound Integrations
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound Integrations
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
 
SFDC Batch Apex
SFDC Batch ApexSFDC Batch Apex
SFDC Batch Apex
 
SFDC Data Loader
SFDC Data LoaderSFDC Data Loader
SFDC Data Loader
 
SFDC Advanced Apex
SFDC Advanced Apex SFDC Advanced Apex
SFDC Advanced Apex
 
SFDC Introduction to Apex
SFDC Introduction to ApexSFDC Introduction to Apex
SFDC Introduction to Apex
 
SFDC Database Additional Features
SFDC Database Additional FeaturesSFDC Database Additional Features
SFDC Database Additional Features
 
Introduction to SalesForce
Introduction to SalesForceIntroduction to SalesForce
Introduction to SalesForce
 
More about java strings - Immutability and String Pool
More about java strings - Immutability and String PoolMore about java strings - Immutability and String Pool
More about java strings - Immutability and String Pool
 
Hibernate First and Second level caches
Hibernate First and Second level cachesHibernate First and Second level caches
Hibernate First and Second level caches
 
Java equals hashCode Contract
Java equals hashCode ContractJava equals hashCode Contract
Java equals hashCode Contract
 
Java Comparable and Comparator
Java Comparable and ComparatorJava Comparable and Comparator
Java Comparable and Comparator
 
Java build tools
Java build toolsJava build tools
Java build tools
 
Java Web services
Java Web servicesJava Web services
Java Web services
 

Recently uploaded

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

SFDC UI - Introduction to Visualforce

  • 1. Force.com User Interface Sujit Kumar Zenolocity LLC © 2012 - 2024
  • 2. Overview • MVC Architecture • Hello World Example • Controllers • View Components • Native UI • Security
  • 3. MVC Architecture • View or Presentation – HTML with VisualForce specific XML tags. • Controller – Apex classes with business logic. • Model (data read and write access) is part of the Controller.
  • 4. Visual Force MVC Architecture
  • 5. Controllers • Interaction of the controller with the UI is via the variables and action methods. • Action methods perform the processing work on behalf of the user. Wired up to buttons, links, and even asynchronous events on the user interface. • Variables exposed to the presentation layer via getters and setters.
  • 6. Types of Controllers • Standard Controllers - replicate the behavior of the native UI, such as editing and creating records, but allow customization without code. • Controllers with Extensions – classes written in Apex that add extend or override behavior of standard controllers. • Custom Controllers – implement from scratch.
  • 7. VisualForce Page • Defines the appearance of the UI using a mixture of standard HTML and VisualForce-specific XML markup. • The XML markup is used to add view components to the page. • View components bind the controller to the page, defining how data and user actions are to be rendered in the user interface. • Force.com provides a standard set of view components to support common HTML UI patterns and supports user-defined components.
  • 8. Interaction between Page and Controller • In the MVC picture, the arrows between the page and the controller represent expressions. • Expressions are embedded in view components to allow the page to reference methods in the controller or in system classes such as UserInfo. • Expressions in Visualforce use the same language as formula fields in the database, with a special prefix and suffix added. • For example, {!save} is an expression that invokes the save method of the controller.
  • 9. Hello World Page <apex:page controller="MyPageController"> <apex:form> Your name: <apex:inputText value="{!name}" /> <apex:outputText value="{!message}" /> <apex:commandButton action="{!hello}" value="Say Hi" /> </apex:form> </apex:page>
  • 10. Hello World MyPageController public class MyPageController { public String name { get; set; } public String message { get; private set; } public PageReference hello() { message = 'Hello, ' + name; return null; } }
  • 11. Standard Controllers • Every database object, both standard and custom, has a standard controller. • Its name is simply the name of the object. • No Apex code exists for a standard controller. • The controller implementation is already provided by Force.com. • By default, the standard controller operates on a single record at a time. It receives this record from the id parameter in the URL.
  • 12. Expressions for Standard Controller Following expressions are available in a page that uses a standard controller. Data: {!id} is the unique identifier of the current record, and {!object} is the current record itself, where object is the lowercase name of the object. All fields of the object are automatically available, including related child objects but not parent objects. Navigation: {!cancel} navigates to the cancel page, {!edit} to the standard edit page, and {!view} to the standard view page. Action and Navigation: {!delete} deletes the current record and navigates to the standard delete page, and {!save} saves the current record and refreshes the page. Action Only: {!quicksave} saves the current record without navigation.
  • 13. Standard Set Controller • Operates on a list of records rather than a single record. The list is produced by executing a view, a user-defined set of column names, filter criteria, and sort criteria for an object. <apex:page standardController="Proj__c recordSetVar="projects"> <apex:repeat value="{!projects}" var="p"> {!p.Name}<br /> </apex:repeat> </apex:page>
  • 14. Standard Set Controller • The recordSetVar indicates to Force.com that the standard set controller should be used. • Can work with up to 10,000 records at a time. • Supports pagination with a variable page size. It also supports multiple selection and actions on a selected set of records.
  • 15. • Data: The variable name you set in recordSetVar is bound to the current list of records, {!selected} is an array of SObjects that are selected, {!resultsSize} sets or gets the number of records currently displayed, and {!completeResult} is a Boolean containing false if more than 10,000 records exist. • Pagination: Navigate across multiple pages of data using the {!first}, {!last}, {!next}, and {!previous} actions. {!pageNumber} sets or gets the current page number, and {!pageSize} sets or gets the number of records in a page. {!hasPrevious} returns true if a previous page exists, {!hasNext} returns true if a subsequent page exists. • Filters: {!filterId} is the unique identifier of the currently selected filter (list view), and {!listViewOptions} is an array of SelectOption objects containing the names and identifiers of the available list views. • Navigation: {!cancel} navigates to the cancel page, and {!edit} to the standard edit page. • Action and Navigation: {!delete} deletes the current record and navigates to the standard delete page, and {!save} saves the current record and refreshes the page. • Action Only: {!quicksave} saves the current record without navigation.
  • 16. Controller Extensions • Extends or Overrides the behavior of a Standard or a Custom Controller. • Primarily used to integrate Visualforce more tightly with the native user interface. Many features of Visualforce integration such as overriding standard buttons are not supported for pages that use custom controllers. • Custom controllers can be easily retrofitted to become controller extensions. • Multiple extensions can be used in a single page, enabling a large monolithic controller to be divided into smaller controllers by behavior, where some pages might use only a subset of the behaviors.
  • 17. Controller Extensions (contd…) • A controller extension is any Apex class containing a constructor that takes a single argument of type ApexPages.StandardController or CustomControllerName, where CustomControllerName is the name of a custom controller you want to extend. • Multiple controller extensions can be defined for a single page through a comma-separated list. This allows for overrides of methods with the same name. • Overrides are defined by whichever methods are defined in the “leftmost” extension, or, the extension that is first in the comma-separated list.
  • 18. Example: Controller Extensions • Controller with Extensions public class MyPageController { private ApexPages.StandardController controller; public MyPageController(ApexPages.StandardController controller) { this.controller = controller; } public PageReference doSomething() { return null; } } • Page Using Sample Controller Extension <apex:page standardController="Resource__c“ extensions="MyPageController"> <apex:form> <apex:commandButton action="{!doSomething}" value="Do Something" /> </apex:form> </apex:page>
  • 19. Custom Controllers • Provide complete control over the behavior of a page with no default implementation. • Simply an Apex class designed to be bound to a Visualforce page. No new syntax to learn. • Involves defining the data to make available to the page and the actions that the page can invoke. • Page Components use expressions to bind data exposed in the Controller. This binding is by reference, so data can be modified in the page or the Controller.
  • 20. Example Custom Controller public class MyPageController { public Proj__c proj { get; private set; } public MyPageController() { proj = [ SELECT Name, Account__r.BillingCity FROM Proj__c WHERE Name = 'Tim Barr' LIMIT 1 ]; } }
  • 21. Expression Language • Expression language allows traversal of an object through dot notation, so providing separate getters and setters for every field in a database record, for example, is not necessary. Expose the object itself and use dot notation to access its fields. • you can combine expressions to form more complex expressions. The expression {!isVisible && isEditable} invokes both the getIsVisible and getIsEditable methods on the controller and evaluates to true if they are both true. • Conditional expressions are also supported.
  • 22. Action Methods • Actions on a page are wired up to action methods in the controller, again by expression language. • Action methods are public, non-static controller methods. • Return a PageReference object or null. If null, the current page is refreshed. If not, the PageReference is used to determine the location of the new page. • Use the setRedirect method on a PageReference. A redirect updates the browser’s URL, resets the view state and prevents problems with the browser’s reload button. • Perform custom business logic, like using DML methods to insert a record to the database.
  • 23. View Components • View components work with the controller to define the appearance and behavior of a Visualforce user interface. • They connect variables in the controller to input and output elements such as text boxes and labels, and methods in the controller to action-oriented elements such as buttons and links. • Force.com provides a library of standard view components to support common Web user interface design patterns.
  • 24. Types of View Components • Data Components – move data in/out of the controller using HTML elements. • Action Components - invoke methods on the controller, updating the view state and refreshing the page or navigating to a new page. • Primitive Components – similar syntax to HTML elements. • Force.com Styled Components – allow pages to inherit the style of the native UI. • Force.com UI Components - – allow pages to inherit the style & behavior of the native UI – list Views, enhanced List Views, related List views, detail views. • Custom Components
  • 25. View Components Basics • View components are embedded in a Visualforce page using XML markup. • Every user interface page must begin with the page component. • All Visualforce components must be declared within the page component. • The rendered attribute, present on most components allows conditional rendering of its HTML. It is a boolean value that indicates whether the component is included in the page. Setting rendered to false does not hide the component using CSS. It omits it entirely from the rendered page.
  • 26. Example of a View Component • The XML markup of a view component consists of three parts: the component name, an optional set of attributes, and an optional component body. <apex:dataList value="{!resources}" var="resource"> <b>{!resource.Name}</b> </apex:dataList>
  • 27. Page Definition • Every Visualforce user interface page must begin with the page component. • Connect the page to a controller and optionally override the global appearance of the page. • Requires either a standard (standardController attribute) or a custom controller (controller attribute) or a controller extension (via the extensions attribute).
  • 28. Page Definition Style • By default, pages are styled consistently with the Force.com native UI. • include its stylesheet, sidebar, and header region containing application tabs, banner, and drop-down list of applications. • Override this behavior by setting the standardStylesheets, sidebar, and showHeader Boolean attributes.
  • 29. Data Components • Allow DB fields and records to be manipulated within a Visualforce page. 3 Types: • Metadata-Aware Components: The HTML rendered by these smart components varies based on the definition of the field. These components are valid only when bound to database objects. • Primitive Data Components: If field data is contained in a variable in Apex code rather than a database object, use primitive data components to render input and output HTML elements bound to their values. • Repeating Components: If you have a list of any type of object, you can iterate over it with a repeating component to render its contents.
  • 30. Metadata-Aware Components • 2 components: one for input (inputField) and one for output (outputField). • inputField must be within a Form component. • For inputField, the html displayed depends on the database field it is bound to. • The outputField formats the value of a field using the correct pattern for that field’s data type.
  • 31. Primitive Data Components • Add Visualforce functionality to standard HTML tags. • Use these components when you are working with data that is not contained in a database object or when the standard Visualforce rendering or behavior is not desirable. • Except outputLabel, all components listed in the table must be contained in a form component or else compilation fails. • Examples: inputText, selectList, selectRadio, etc.
  • 32. Repeating Data Components • Bound to a list of values, iterate over them, rendering the component body for each child in the collection. • Attributes: value (collection) and var (current child). • 3 types: dataList (HTML List), dataTable (HTML table) and repeat (no HTML, custom HTML provided by developer).
  • 33. Action Components • Allow the page to invoke a method on the Controller. The method on the controller typically issues a DML & then refreshes the current page or navigates to a new page. • Setter methods on Controller used to inject data from the page. • 2 basic action components: commandButton and commandLink. • Valid only inside a Form Component. • action attribute specifies the name of the controller method to invoke or the URL of a new page to navigate to.
  • 34. Primitive Components • Very similar to standard HTML tags but PCs can do server side conditional rendering which standard HTML cannot. • Visualforce provides the rendered attribute, that improves the performance of pages by conditionally rendering markup based on the state of the controller. • Additional Primitive Components: includeScript and stylesheet. These 2 do not have the rendered attribute, have a val attribute that specifies the URL of the script or style sheet to load. More efficient & ensure scripts and stylesheets are not duplicated on the page.
  • 35. Force.com Styled Components • Force.com’s native UI makes heavy use of CSS and JavaScript within its Web pages to provide a consistent look-and-feel across the platform. • Many Visualforce components deliver this same styling to developers, without requiring any knowledge of Force.com’s CSS or other implementation details. • 5 Categories based on their function: Page Structure, Action Containers, Table, Paging Components, Notifications.
  • 36. Force.com Styled Components - Categories • Page Structure: sectionHeader, pageBlock, pageBlockSection, and pageBlockSectionItem are the native structural elements used by Force.com to organize a page into a hierarchy of clearly identifiable sections, subsections, and sets of label/field pairs. • Action Containers: pageBlockButtons and toolbar / toolbarGroup organize a series of buttons or links for performing actions on the page. • Table: pageBlockTable is used like a dataTable but renders rows and columns in the Force.com native style. • Paging Components: panelBar / panelBarItem and tab / tabPanel group components into pages that can be dynamically shown and hidden. • Notifications: pageMessages displays errors and information.
  • 37. Force.com UI Components • listViews: rendered by Force.com on the list page of an object tab when the Enable Enhanced Lists option is disabled for the organization. • enhancedList: consists of a drop-down list of view names and a table of records returned by executing the view. • relatedList: renders the records of any one of an object’s child objects. • detail: provides a subset of the native user interface’s detail page for an object.
  • 38. listViews Component • Capability to create and edit list views, as well as execute them and render their records. • The only required attribute of listViews is type, which binds a database object type to the component.
  • 39. enhancedList Component • Enhanced version of the listViews component. • Same functionality but also includes drag-and-drop re-orderable columns, sortable columns, and results pagination with dynamic page sizes. • Appears in the native UI only when Enable Enhanced Lists is enabled for the organization. • Required attributes: height and (type of the DB object or the listId of the listView).
  • 40. relatedList Component • Renders a list of paginated child records. • Allows related records to be edited, deleted, and created, depending on the object permissions of the current user. • Required attributes: list (the name of the child relationship to be rendered in the list) and subject (an expression language reference to the parent record on the controller , defaults to the id parameter of the page if not provided). • Both MDRs and LRs are supported.
  • 41. Detail Component • Replicates the functionality of the native UI on the detail page of a record. It respects the page layout of the record, including page layouts defined per record type. • It also supports inline editing for the edit mode of an object. • Requires a subject or it attempts to read a record identifier from the page’s id URL parameter. • By default, all related lists are rendered below the detail section unless the relatedList parameter is set to false.
  • 42. Extensible UI Elements • The following are extensible using Visualforce. • Standard Pages • Standard Buttons • Page Layouts • Custom Buttons and Links • Custom Tabs
  • 43. Extensible UI Elements • Standard Pages: default UI for maintaining the records. Can be overridden with Custom Visualforce pages. • Standard Buttons: navigate the user to standard pages. Can be remapped to navigate the user to custom pages. • Custom Buttons: appear at the top and bottom of standard pages. • Custom Links: appear in a detail page. • Custom Tabs: added to an application and appear at the top under the application banner. A Visualforce page can be configured as a custom tab.
  • 44. Standard Pages • 4 standard pages for working with DB records. • Tab Page: appears when a custom object tab is clicked. Shows recently accessed records. • List Page: shows records in a list. Reach this page by clicking Go button on the tab page. • View Page: read-only view of a single record and it’s related records. • Edit Page: same layout as the view page but lets you change and save the record.
  • 45. Overriding Standard Pages • Tab, view, and edit pages can be overridden only with Visualforce pages that use a standard, single record controller. • The list page must use a standard set controller. • Controller extensions are supported in all pages.
  • 46. Overriding Standard Buttons • 4 buttons can be overridden. • New – navigates to edit page of a new record. • Delete – page navigated to after record is deleted. Default is the list page. • Clone -> to edit page of a duplicated record. • Accept – applies to records owned by a queue rather than a single user. Enables to transfer ownership to the user. Appears on a list page when displaying records owned by a queue.
  • 47. Overriding Page Layouts • A Visualforce page can be embedded in an object’s page layout alongside its fields. • For Visualforce pages to appear in the page layout editor, they cannot already be in use by a tab and must use a standard single record controller, with or without extensions.
  • 48. Custom Buttons and Links • They can navigate to any VF page. • Can be added to page layouts. • Need to be defined on the database object. • Go to App Setup area, click Create -> Objects, and then click the object. Scroll to the Custom Buttons and Links area and click the New button. • Can be added to the detail page layout or related list page layout.
  • 49. Custom Tab • You can configure any Visualforce page as a new tab in the Force.com native UI. • To add a new Visualforce tab, go to the App Setup area and click Create ->Tabs. • Click the New button in the Visualforce Tabs section to create a tab. • Select a Visualforce page, select a tab label and style, set tab visibility on profiles and applications, and click Save.
  • 50. Debugging and Tuning • Look at the System log first. • Add System.debug statements in controller. • Trial & Error – comment out portions of VF page till you can narrow the error. • Use Firebug to find client side errors. • View State is limited to 128k. View State contains the local variables in the controller. • Reduce local variables and/or mark some of them as transient.
  • 51. Visualforce Security • Obeys the object and field level security configured in profiles. • Access to the page itself is granted by user’s profile. • Record security handled by controller through special keywords in Apex.
  • 52. Developer Notes – VF Security • When developing a controller, check that the SOQL, SOSL, and DML operations are fully compatible with the set of profiles expected to use the page. • A developer has full visibility to every object and field, but do not assume that other users have the same level of access. Test the Visualforce pages by logging in as a test user or cycling through profiles on a single test user. • Write unit tests that run under the privileges of a specific user using the System.runAs method.
  • 53. Record Level Security • Standard controllers always honor the record-level security of the current user. • Record sharing rules are ignored by code in custom controllers. These controllers run in a system context, like a trigger. • Record sharing rules are honored by the methods of standard controllers that have extensions defined, but the code in an extension class itself still runs in system mode.
  • 54. Record Sharing – Custom Controllers • Two security modes are available: with sharing and without sharing. • Without Sharing is default mode. • Example of with sharing: public with sharing class MyController { // the code in this controller honors record sharing rules }
  • 55. Page Level Security • Pages must be explicitly enabled for each profile that requires access. If this is not done, users will receive an error page titled Insufficient Privileges when attempting to view the page. • To grant a profile access to a page, go to the Administration Setup and click Manage Users ➝ Profiles. Scroll to the Enabled Visualforce Page Access section and click the Edit button. Select pages from the Available Visualforce Pages list and click the Add button to add them to the Enabled Visualforce Pages list. Click Save. • Users with the Customize Application permission can access all Visualforce pages in the organization.
  • 56. Uncaught Exceptions • In triggers, good formatted message is shown. • In VF page, generic error page whose appearance cannot be controlled or customized. • Goals of error handling in VF pages – avoid uncaught exceptions. • Place a try/catch block around every action method, or at least those that perform SOSL, SOQL, or DML operations. • Catch all exceptions and rollback the transaction using a savepoint in the controller method.
  • 57. Error Communication • VF provides page components and corresponding data objects for communicating errors to the user in a consistent way. • The page components are messages and pageMessages, which display the page-level errors returned by a controller. • These components are placed on pages, typically at the top, and render the ApexPages.Message objects added to the page. • Message objects contain a message and optional severity. • Severity is used to style the message when displayed in the pageMessages component and can also be filtered on in test methods. • Example of code to add an error-severity message to the page. To be visible, it must be rendered by a messages or pageMessages component. ApexPages.addMessage(new ApexPages.Message( ApexPages.Severity.ERROR, 'Something went wrong'));
  • 58. Governor Limits • Apply during execution of user-initiated actions and are not cumulative. When an action is complete, the governor limits reset. • Heap => 3MB. • Apex code => 200,000 lines of code executed. • SOQL => 100 queries. • Records from SOQL => 50,000 records cumulatively for all SOQL queries. • DML => 150 DML statements. • Records in DML => 10,000 records cumulatively for all DML statements.