2. AGENDA
• What is the visualforce
• Tags of the visualforce
• Controller
• Visualforce benefits
• Visualforce Page Architecture
3. WHAT IS THE VISUALFORCE :
Visualforce is the component based user interface framework for the
Force.com platform. Visualforce is a markup language similar to HTML.
Visualforce uses the traditional model-view-controller(MVC) paradigm ,
with the option to use auto-generated controllers for database objects,
providing simple and tight integration with the database. You can write
your own controllers, or extensions to controllers, using Apex Code.
4. WORKS WITH ALL STANDARD WEB
TECHNOLOGIES INCLUDING:
CSS
JavaScript
HTML
Flash
Using JavaScript in Visualforce pages gives you access to a wide range
of existing JavaScript functionality,
5. HOW TO CREATE VISUALFORCE PAGE :-
With development mode enabled, you can create your first
Visualforce page by entering a URL for the page in your browser's
address bar as follows:
https://salesforce_instance/apex/pageName this give error
message Because the page does not yet exist, you are directed to
an intermediary page from which you can create your new page.
Click Create Page <myNewPageName> to create it automatically.
7. SOME TAGS OF VISUALFORCE :-
1. <apex:page> calls an action when the page is loaded
2. <apex:actionFunction> defines a new JavaScript function that calls
an action
3. <apex:stylesheet value="{!$Resource.<filename>}"/>
4. <apex:outputText>
5. <apex:commandButton> creates a button that calls an action
6. <apex:commandLink> creates a link that calls an action
7. <apex:actionSupport> makes an event (such as “onclick”,
“onmouseover”, and so on) on another, named component,
call an action.
8. SOME TAGS OF VISUALFORCE :-
8. <apex:pageBlock >
9. <apex:pageBlockTable value="{!accounts}" var="a">
10. <apex:column value="{!a.name}"/>
11. <apex:form id="theForm">
9. DISPLAYING FIELD VALUES WITH
VISUALFORCE
Visualforce pages use the same expression language as formulas—that
is, anything inside {! } is evaluated as an expression that can access
values from records that are currently in context. For example, you can
display the current user's first name by adding the {!$User.FirstName}
expression
11. CONTROLLERS
A Visualforce controller is a set of instructions that specify what happens when a
user interacts with the components specified in associated Visualforce markup,
such as when a user clicks a button or link. Controllers also provide access to
the data that should be displayed in a page, and can modify component
behavior.
Types of Controllers :-
1. Standard Controller
2. Custom Controller
3. Extension
12. CONTROLLERS
Visualforce markup can use the following types of controller extension
and custom controller methods:
• Action
• Getter
• Setter
13. VISUALFORCE BENEFITS
• User-friendly development
• Integration with other Web-based user interface technologies
• Model-View-Controller (MVC) style development
• Concise syntax
• Automatically upgradeable
16. MVC MEANING-
• Model - includes the custom and standard objects.
• View - is defined by VF pages.
• Visualforce Page - are the salesforce created pages. That is a
markup language.
• Controller - includes the standard,custom, extension classes.
• That are also known as - Standard controller, custom
controller and extension controller.